summaryrefslogtreecommitdiff
path: root/mail/oe2mbx/patches/patch-aa
blob: bff0ac481edf3934976fa8642d0560c200c4d5e6 (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
$NetBSD: patch-aa,v 1.3 2022/09/23 12:22:39 nia Exp $

--- makefile.orig	2000-06-17 15:30:36.000000000 +0000
+++ makefile
@@ -1,22 +1,26 @@
 # MAKEFILE FOR LIBOE AND OE2MBX
 # Read README for info
 
-PREFIX = /usr
+PREFIX ?= /usr
 LIBDIR = $(PREFIX)/lib
 BINDIR = $(PREFIX)/bin
 INCLUDEDIR = $(PREFIX)/include
 
-oe2mbx : src/oe2mbx.c lib/liboe.o
-	gcc src/oe2mbx.c lib/liboe.o -o bin/oe2mbx
-dynamic : src/oe2mbx.c
-	gcc src/oe2mbx.c -DDYNAMIC -o bin/oe2mbx -loe
-liboe : src/liboe.c
-	gcc -c src/liboe.c -o lib/liboe.so
+oe2mbx : src/oe2mbx.o lib/liboe.o
+	$(CC) $(LDFLAGS) src/oe2mbx.o lib/liboe.o -o bin/oe2mbx
+dynamic : src/oe2mbx.o
+	$(CC) $(LDFLAGS) src/oe2mbx.o -DDYNAMIC -o bin/oe2mbx -loe
+liboe : src/liboe.o
+	$(CC) $(LDFLAGS) -shared src/liboe.o -o lib/liboe.so
+
+src/oe2mbx.o : src/oe2mbx.c
+	$(CC) $(CFLAGS) -c src/oe2mbx.c -o src/oe2mbx.o
+
 lib/liboe.o : src/liboe.c
-	gcc -c src/liboe.c -o lib/liboe.o	
+	$(CC) $(CFLAGS) -c src/liboe.c -o lib/liboe.o	
 install : 
-	test -e bin/* && install bin/* $(BINDIR) && echo oe2mbx binary installed || echo oe2mbx binary not prepared
-	test -e lib/*.so && install lib/*.so $(LIBDIR) && install src/*.h $(INCLUDEDIR) && echo liboe library installed || echo liboe library not prepared
+	test -r bin/* && ${INSTALL_PROGRAM} bin/* ${DESTDIR}$(BINDIR) && echo oe2mbx binary installed || echo oe2mbx binary not prepared
+	test -r lib/*.so && ${INSTALL_LIB} lib/*.so ${DESTDIR}$(LIBDIR) && ${INSTALL_DATA} src/*.h ${DESTDIR}$(INCLUDEDIR) && echo liboe library installed || echo liboe library not prepared
 clean	:
-	test -e bin/* && rm -f bin/* || test .
-	test -e lib/* && rm -f lib/* || test .
+	test -r bin/* && rm -f bin/* || test .
+	test -r lib/* && rm -f lib/* || test .