install.sh: create a www_fullchain.pem file
[girocco.git] / src / GNUmakefile
blobd11d1c0e5618f69015c813130d6ec52e8946751c
1 CC ?= cc
2 CFLAGS ?= -O
4 .PHONY : all clean install FORCE
6 all : can_user_push can_user_push_http getent get_user_uuid list_packs \
7 peek_packet rangecgi readlink strftime throttle ulimit512 ltsha256
9 clean :
10 rm -rf can_user_push.o* can_user_push.d* can_user_push
11 rm -rf can_user_push_http.o* can_user_push_http.d* can_user_push_http
12 rm -rf getent.o* getent.d* getent
13 rm -rf get_user_uuid.o* get_user_uuid.d* get_user_uuid
14 rm -rf list_packs.o* list_packs.d* list_packs.inc list_packs
15 rm -rf peek_packet.o* peek_packet.d* peek_packet
16 rm -rf rangecgi.o* rangecgi.d* rangecgi
17 rm -rf readlink.o* readlink.d* readlink
18 rm -rf strftime.o* strftime.d* strftime
19 rm -rf throttle.o* throttle.d* throttle
20 rm -rf ulimit512.o* ulimit512.d* ulimit512
21 rm -rf ltsha256.o* ltsha256.d* ltsha256
22 rm -f config.h GROUP-FILE PASSWD-FILE SOCKET-FILE
24 install :
26 test : ltsha256
27 ./ltsha256-test.sh | awk 'BEGIN{c=0} {print} /^ok [0-9]/{++c} END{if(NR!=c+1)exit 1}'
29 GET_CONFIG = cd .. && test ! -f config.sh || . ./config.sh && . ./shlib.sh
31 TRACK_GROUP_FILE := $(shell $(GET_CONFIG) && echo "$$cfg_chroot/etc/group")
32 export TRACK_GROUP_FILE
33 TRACK_PASSWD_FILE := $(shell $(GET_CONFIG) && echo "$$cfg_chroot/etc/passwd")
34 export TRACK_PASSWD_FILE
35 TRACK_SOCKET_FILE := $(shell $(GET_CONFIG) && echo "$$cfg_chroot/etc/taskd.socket")
36 export TRACK_SOCKET_FILE
38 GROUP-FILE: FORCE
39 @if test x"$$TRACK_GROUP_FILE" != x"`cat GROUP-FILE 2>/dev/null`"; then \
40 echo "* new group file location"; \
41 echo "$$TRACK_GROUP_FILE" >GROUP-FILE; \
44 PASSWD-FILE: FORCE
45 @if test x"$$TRACK_PASSWD_FILE" != x"`cat PASSWD-FILE 2>/dev/null`"; then \
46 echo "* new passwd file location"; \
47 echo "$$TRACK_PASSWD_FILE" >PASSWD-FILE; \
50 SOCKET-FILE: FORCE
51 @if test x"$$TRACK_SOCKET_FILE" != x"`cat SOCKET-FILE 2>/dev/null`"; then \
52 echo "* new taskd.pl socket file location"; \
53 echo "$$TRACK_SOCKET_FILE" >SOCKET-FILE; \
56 config.h : make-config-h.sh
57 V="$(V)" ./make-config-h.sh "$(CC)" >$@
59 can_user_push : can_user_push.c
60 $(CC) -o $@ $(CFLAGS) $?
62 can_user_push_http : can_user_push_http.c GROUP-FILE
63 $(CC) -o $@ $(CFLAGS) -D"GROUP_FILE=\"$(TRACK_GROUP_FILE)\"" can_user_push_http.c
65 getent : getent.c
66 $(CC) -o $@ $(CFLAGS) $?
68 get_user_uuid : get_user_uuid.c PASSWD-FILE
69 $(CC) -o $@ $(CFLAGS) -D"PASSWD_FILE=\"$(TRACK_PASSWD_FILE)\"" get_user_uuid.c
71 list_packs.inc : list_packs.txt
72 sed -e 's/\([\\"]\)/\\\1/g;s/^/"/;s/$$/\\n"/' $< >$@
74 list_packs : list_packs.c list_packs.inc
75 $(CC) -o $@ $(CFLAGS) list_packs.c
77 peek_packet : config.h peek_packet.c
78 $(CC) -o $@ $(CFLAGS) -DCONFIG_H='"config.h"' peek_packet.c
80 rangecgi : rangecgi.c
81 $(CC) -o $@ $(CFLAGS) rangecgi.c
83 readlink : readlink.c
84 $(CC) -o $@ $(CFLAGS) readlink.c
86 strftime : strftime.c
87 $(CC) -o $@ $(CFLAGS) strftime.c
89 throttle : throttle.c SOCKET-FILE
90 $(CC) -o $@ $(CFLAGS) -D"SOCKET_FILE=\"$(TRACK_SOCKET_FILE)\"" throttle.c
92 ulimit512 : ulimit512.c
93 $(CC) -o $@ $(CFLAGS) ulimit512.c
95 ltsha256 : ltsha256.c lt256.h lt256.c
96 $(CC) -o $@ $(CFLAGS) ltsha256.c