summaryrefslogtreecommitdiff
path: root/cad/nelma/patches/patch-ab
blob: 0279d0eca844bfaae05e13d2a7cd8b98394f7bd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$NetBSD: patch-ab,v 1.4 2010/01/28 19:27:03 joerg Exp $

--- src/Makefile.orig	2006-12-10 13:10:30.000000000 -0500
+++ src/Makefile
@@ -25,31 +25,31 @@ DECOMPOSE_OBJS =	pngutil.o \
 			error.o \
 			decompose.o
 
-CONF_CFLAGS = $(shell pkg-config --cflags libconfuse)
-CONF_LIBS = $(shell pkg-config --libs libconfuse)
+#CONF_CFLAGS = $(shell pkg-config --cflags libconfuse)
+#CONF_LIBS = $(shell pkg-config --libs libconfuse)
 
-CFLAGS = -Wall -O3 -march=athlon-xp $(CONF_CFLAGS) -ffast-math
+CFLAGS?= -Wall -O3 -march=athlon-xp $(CONF_CFLAGS) -ffast-math
 #CFLAGS = -Wall -g -march=athlon-xp $(CONF_CFLAGS) -pg
 #CFLAGS = -Wall -g -march=athlon-xp $(CONF_CFLAGS) -DDEBUG
 
 #CFLAGS = -Wall -g -march=athlon-xp $(CONF_FLAGS) -ffast-math -O2
 
 #LDFLAGS = $(CONF_LIBS) -lpng -pg
-LDFLAGS = $(CONF_LIBS) -lpng
+LDADD = `pkg-config --libs libpng` `pkg-config --libs libconfuse` -lm
 
 all: nelma-cap decompose nelma-drc
 
-%.o: %.c
-	$(CC) $(CFLAGS) $(INCS) -c $< -o $@
+.c.o:
+	$(CC) $(CFLAGS) `pkg-config --cflags libpng` `pkg-config --cflags libconfuse` $(INCS) -c $< -o $@
 
 nelma-cap: $(NELMA_CAP_OBJS)
-	$(CC) $^ -o $@ $(LDFLAGS) 
+	$(CC) $(NELMA_CAP_OBJS) -o $@ $(LDFLAGS) $(LDADD)
 
 nelma-drc: $(NELMA_DRC_OBJS)
-	$(CC) $^ -o $@ $(LDFLAGS) 
+	$(CC) $(NELMA_DRC_OBJS) -o $@ $(LDFLAGS) $(LDADD)
 
 decompose: $(DECOMPOSE_OBJS)
-	$(CC) $^ -o $@ $(LDFLAGS) 
+	$(CC) $(DECOMPOSE_OBJS) -o $@ $(LDFLAGS) $(LDADD)
 
 clean: 
 	rm -f $(NELMA_CAP_OBJS)
@@ -58,8 +58,9 @@ clean: 
 	rm -f nelma-cap
 	rm -f nelma-drc
 
+INSTALL_PROGRAM?=	install
 install: all
-	install nelma-cap $(PREFIX)/bin
-	install nelma-drc $(PREFIX)/bin
+	$(BSD_INSTALL_PROGRAM) nelma-cap ${DESTDIR}$(PREFIX)/bin
+	$(BSD_INSTALL_PROGRAM) nelma-drc ${DESTDIR}$(PREFIX)/bin
 
 .PHONY:	all clean install