This repository was archived by the owner on Nov 12, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (57 loc) · 1.48 KB
/
Makefile
File metadata and controls
72 lines (57 loc) · 1.48 KB
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
DRC_GENERATED_FILES = $(patsubst Resources/%.in,%,$(wildcard Resources/*.in))
CFLAGS = -g -O2 -Wall
VERSION = 0.0.2
CC = gcc
RM = rm -f
FIND = find
QUIET_CC = @echo ' ' CC $@;
QUIET_LINK = @echo ' ' LINK $@;
QUIET_GEN = @echo ' ' GEN $@;
HIDE = @echo;
.PHONY: all
all: dcheck dissemina
dissemina: dissemina.o commonpages.o
$(QUIET_LINK)$(CC) $^ -o $@
dissemina.o: dissemina.c dstdio.h dstring.h dhandlers.h drequest.h
$(QUIET_CC)$(CC) -c $(CFLAGS) -DVERSION=\"$(VERSION)\" dissemina.c -o $@
%.o: %.c
$(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
commonpages.c: Resources/commonpages.c.in
$(QUIET_GEN)./drc $< > $@
tags:
$(RM) tags
$(FIND) . -name '*.[hc]' -print | xargs etags -a
FILES: *.[ch]
@echo ' ' RM $@; $(RM) $@
$(QUIET_GEN) echo "What each file is" > $@ && \
echo "" >> $@ && \
for f in *.[ch]; do\
echo "/" >> $@;\
head -10 $$f | grep -E '^[^/]\*([^/]|$$)' | cut -c4- | sed 's/\t/ /g' | awk '{ print "| ",$$0 } ' >> $@;\
echo "\\" >> $@;\
echo >> $@;\
done &&\
echo >> $@ &&\
echo "Generated by Makefile at "$$(ddate "+%e %B %Y") >> $@
.PHONY: clean
clean:
$(RM) dissemina
$(RM) *.o
$(RM) $(DRC_GENERATED_FILES)
.PHONY: distclean
distclean: clean
.PHONY: realclean
realclean: clean
.PHONY: test
test: dissemina
pkill dissemina || true
./dissemina &
sleep 1
cat tests.dcheck | ./dcheck -s | grep FAILED || true
pkill dissemina || true
testv: dissemina
pkill dissemina || true
./dissemina &
sleep 1
cat tests.dcheck | ./dcheck -v
pkill dissemina || true