install.sh: verify $Girocco::Config::nc_openbsd_bin supports -U
[girocco.git] / src / GNUmakefile
blob1ac168a913e0f927eb4b42ac6659cbecb7138ba2
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 strftime throttle
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 strftime.o* strftime.d* strftime
18 rm -rf throttle.o* throttle.d* throttle
19 rm -f GROUP-FILE PASSWD-FILE SOCKET-FILE
21 install :
23 TRACK_GROUP_FILE := $(shell cd .. && . ./shlib.sh && echo "$$cfg_chroot/etc/group")
24 export TRACK_GROUP_FILE
25 TRACK_PASSWD_FILE := $(shell cd .. && . ./shlib.sh && echo "$$cfg_chroot/etc/passwd")
26 export TRACK_PASSWD_FILE
27 TRACK_SOCKET_FILE := $(shell cd .. && . ./shlib.sh && echo "$$cfg_chroot/etc/taskd.socket")
28 export TRACK_SOCKET_FILE
30 GROUP-FILE: FORCE
31 @if test x"$$TRACK_GROUP_FILE" != x"`cat GROUP-FILE 2>/dev/null`"; then \
32 echo "* new group file location"; \
33 echo "$$TRACK_GROUP_FILE" >GROUP-FILE; \
36 PASSWD-FILE: FORCE
37 @if test x"$$TRACK_PASSWD_FILE" != x"`cat PASSWD-FILE 2>/dev/null`"; then \
38 echo "* new passwd file location"; \
39 echo "$$TRACK_PASSWD_FILE" >PASSWD-FILE; \
42 SOCKET-FILE: FORCE
43 @if test x"$$TRACK_SOCKET_FILE" != x"`cat SOCKET-FILE 2>/dev/null`"; then \
44 echo "* new taskd.pl socket file location"; \
45 echo "$$TRACK_SOCKET_FILE" >SOCKET-FILE; \
48 can_user_push : can_user_push.c
49 $(CC) -o $@ $(CFLAGS) $?
51 can_user_push_http : can_user_push_http.c GROUP-FILE
52 $(CC) -o $@ $(CFLAGS) -D"GROUP_FILE=\"$(TRACK_GROUP_FILE)\"" can_user_push_http.c
54 getent : getent.c
55 $(CC) -o $@ $(CFLAGS) $?
57 get_user_uuid : get_user_uuid.c PASSWD-FILE
58 $(CC) -o $@ $(CFLAGS) -D"PASSWD_FILE=\"$(TRACK_PASSWD_FILE)\"" get_user_uuid.c
60 list_packs.inc : list_packs.txt
61 sed -e 's/\([\\"]\)/\\\1/g;s/^/"/;s/$$/\\n"/' $< >$@
63 list_packs : list_packs.c list_packs.inc
64 $(CC) -o $@ $(CFLAGS) list_packs.c
66 peek_packet : peek_packet.c
67 $(CC) -o $@ $(CFLAGS) peek_packet.c
69 rangecgi : rangecgi.c
70 $(CC) -o $@ $(CFLAGS) rangecgi.c
72 strftime : strftime.c
73 $(CC) -o $@ $(CFLAGS) strftime.c
75 throttle : throttle.c SOCKET-FILE
76 $(CC) -o $@ $(CFLAGS) -D"SOCKET_FILE=\"$(TRACK_SOCKET_FILE)\"" throttle.c