summaryrefslogtreecommitdiff
path: root/package/mini_httpd/patches/patch-Makefile
blob: 5a574b21c14fa8d2dc7e634b36fa0746b0a19fa2 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
$Id$
--- mini_httpd-1.19.orig/Makefile	2002-11-01 23:02:57.000000000 +0000
+++ mini_httpd-1.19/Makefile	2007-03-20 13:35:49.000000000 +0000
@@ -14,30 +14,44 @@ CRYPT_LIB =    -lcrypt
 # http://www.openssl.org/  Make sure the SSL_TREE definition points to the
 # tree with your OpenSSL installation - depending on how you installed it,
 # it may be in /usr/local instead of /usr/local/ssl.
+
+# OpenSSL
 #SSL_TREE =	/usr/local/ssl
 #SSL_DEFS =	-DUSE_SSL
 #SSL_INC =	-I${SSL_TREE}/include
 #SSL_LIBS =	-L${SSL_TREE}/lib -lssl -lcrypto
+#SSL_OBJS =
 
+# MatrixSSL
+#SSL_TREE =
+#SSL_DEFS =	-DUSE_SSL -DHAVE_MATRIXSSL
+#SSL_INC =
+#SSL_LIBS =	-lmatrixssl
+#SSL_OBJS =	matrixssl_helper.o
 
-BINDIR =	/usr/local/sbin
-MANDIR =	/usr/local/man
-CC =		gcc
+
+DESTDIR =
+
+BINDIR =	$(DESTDIR)/usr/sbin
+MANDIR =	$(DESTDIR)/usr/share/man
+CC ?=		gcc
 CDEFS =		${SSL_DEFS} ${SSL_INC}
-CFLAGS =	-O ${CDEFS}
-#CFLAGS =	-g ${CDEFS}
-LDFLAGS =	-s
+CFLAGS +=	${CDEFS}
+LDFLAGS ?=
 #LDFLAGS =	-g
 LDLIBS =	${SSL_LIBS} ${SYSV_LIBS} ${CRYPT_LIB}
 
 all:		mini_httpd htpasswd
 
-mini_httpd:	mini_httpd.o match.o tdate_parse.o
-	${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${LDLIBS} -o mini_httpd
+mini_httpd:	mini_httpd.o match.o tdate_parse.o ${SSL_OBJS}
+	${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${SSL_OBJS} ${LDLIBS} -o mini_httpd
 
 mini_httpd.o:	mini_httpd.c version.h port.h match.h tdate_parse.h mime_encodings.h mime_types.h
 	${CC} ${CFLAGS} -c mini_httpd.c
 
+matrixssl_helper.o: matrixssl_helper.c
+	${CC} ${CFLAGS} -c matrixssl_helper.c
+	
 match.o:	match.c match.h
 	${CC} ${CFLAGS} -c match.c
 
@@ -71,16 +85,18 @@ mini_httpd.pem:	mini_httpd.cnf
 	chmod 600 mini_httpd.pem
 
 
-install:	all
-	rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd
+install:	all uninstall
 	-mkdir -p ${BINDIR}
 	cp mini_httpd htpasswd ${BINDIR}
-	rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1
 	-mkdir -p ${MANDIR}/man8
 	cp mini_httpd.8 ${MANDIR}/man8
 	-mkdir -p ${MANDIR}/man1
 	cp htpasswd.1 ${MANDIR}/man1
 
+uninstall:
+	rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd
+	rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1
+
 clean:
 	rm -f mini_httpd mime_encodings.h mime_types.h htpasswd mini_httpd.rnd *.o core core.* *.core