-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.in
More file actions
77 lines (63 loc) · 1.9 KB
/
Copy pathMakefile.in
File metadata and controls
77 lines (63 loc) · 1.9 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
72
73
74
75
76
77
.POSIX:
.SUFFIXES:
.SUFFIXES: .c .o .uto
VERSION = 1.0.0
CC = @CC@
CCOV = gcov
CFLAGS = @CFLAGS@
CFLAGS_COV = @CFLAGS_COV@
CFLAGS_SAN = @CFLAGS_SAN@
INCLUDEDIR = @PREFIX@/include
LD = @LD@
LIBDIR = @PREFIX@/lib
PREFIX = @PREFIX@
.PHONY: all
all: librfc3339.a
librfc3339.a: rfc3339.o
$(LD) -r $< -o $@
.c.o:
$(CC) $(CFLAGS) -I. -c $< -o $@
.c.uto:
$(CC) $(CFLAGS) $(CFLAGS_COV) $(CFLAGS_SAN) -c $^ -o $@
test_readme: README.md librfc3339.a
awk '/```c/{ C=1; next } /```/{ C=0 } C' README.md | sed -e 's#librfc3339/##' > test_readme.c
$(CC) $(CFLAGS) $(CFLAGS_SAN) -I. test_readme.c librfc3339.a -o $@
./$@
rfc3339.coverage: rfc3339.uto tests/test_rfc3339.o
$(CC) $(CFLAGS) $(CFLAGS_COV) $(CFLAGS_SAN) -I. $^ -o $@
./$@
$(CCOV) rfc3339.c
! grep "#####" rfc3339.c.gcov
librfc3339.pc:
( echo 'Name: librfc3339' ;\
echo 'Version: $(VERSION)' ;\
echo 'Description: RFC3339 Date/Time Formatter' ;\
echo 'prefix=$(PREFIX)' ;\
echo 'exec_prefix=$${prefix}' ;\
echo 'includedir=$${prefix}/include' ;\
echo 'libdir=$${prefix}/lib' ;\
echo 'Cflags: -I$${includedir}' ;\
echo 'Libs: -L$${libdir} -lrfc3339' ) > $@
.PHONY: test
test: test_readme
test: rfc3339.coverage
.PHONY: install
install: rfc3339.h librfc3339.a librfc3339.pc
mkdir -p $(DESTDIR)$(INCLUDEDIR)/librfc3339
mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
install -m644 rfc3339.h $(DESTDIR)$(INCLUDEDIR)/librfc3339/rfc3339.h
install -m644 librfc3339.a $(DESTDIR)$(LIBDIR)/librfc3339.a
install -m644 librfc3339.pc $(DESTDIR)$(LIBDIR)/pkgconfig/librfc3339.pc
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(INCLUDEDIR)/librfc3339/rfc3339.h
rm -f $(DESTDIR)$(LIBDIR)/librfc3339.a
rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/librfc3339.pc
.PHONY: clean
clean:
rm -f *.o **/*.o *.uto **/*.uto *.gc?? **/*.gc?? *.coverage
rm -f librfc3339.a librfc3339.pc
rm -f test_readme*
.PHONY: distclean
distclean: clean
rm -f Makefile config.status