-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
133 lines (104 loc) · 3.87 KB
/
Makefile.in
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Makefile.in
abs_top_srcdir = @abs_top_srcdir@
datarootdir = @datarootdir@
objdir = @objdir@
rundir = @rundir@
headerdir = $(rundir)/include/wired
empty =
WI_VERSION = @WI_VERSION@
WI_MAINTAINER = @WI_MAINTAINER@
DISTFILES = LICENSE Makefile Makefile.in config.guess config.h.in \
config.status config.sub configure configure.in install-sh \
libwired test
SOURCEDIRS = $(abs_top_srcdir)/libwired $(abs_top_srcdir)/test
VPATH = $(subst $(empty) $(empty),:,$(shell find $(SOURCEDIRS) -name ".*" -prune -o -type d -print))
LIBWIREDOBJECTS = $(addprefix $(objdir)/libwired/,$(sort $(notdir $(patsubst %.c,%.o,$(shell find $(abs_top_srcdir)/libwired -name "[a-z]*.c")))))
TESTOBJECTS = $(addprefix $(objdir)/libwired/,$(notdir $(patsubst %.c,%.o,$(shell find $(abs_top_srcdir)/test -name "[a-z]*.c"))))
TESTSOBJECTS = $(addprefix $(objdir)/libwired/,$(notdir $(patsubst %.c,%.o,$(shell find $(abs_top_srcdir)/test/tests -name "[a-z]*.c"))))
HEADERS = $(addprefix $(headerdir)/,$(notdir $(shell find $(abs_top_srcdir)/libwired -name "[a-z]*.h")))
DEFS = @DEFS@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ -DWI_TEST_ROOT=\"$(abs_top_srcdir)/test\"
LDFLAGS = -L$(rundir)/lib @LDFLAGS@
LIBS = -lwired @LIBS@
INCLUDES = -I$(abs_top_srcdir) -I$(rundir)/include -I$(abs_top_srcdir)/test
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
PREPROCESS = $(CC) -E $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
DEPEND = $(CC) -MM $(INCLUDES) $(CPPFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
ARCHIVE = ar rcs $@
.PHONY: all test dist clean distclean scmclean
ifeq ($(WI_MAINTAINER), 1)
ALL = Makefile configure config.h.in $(rundir)/lib/libwired.a $(rundir)/test
else
ALL = $(rundir)/lib/libwired.a
endif
all: $(ALL)
ifeq ($(WI_MAINTAINER), 1)
Makefile: Makefile.in config.status
$(abs_top_srcdir)/config.status
configure: configure.in
autoconf
config.h.in: configure.in
autoheader
touch $@
rm -f $@~
endif
$(rundir)/lib/libwired.a: $(HEADERS) $(LIBWIREDOBJECTS)
@test -d $(@D) || mkdir -p $(@D)
$(ARCHIVE) $(LIBWIREDOBJECTS)
$(objdir)/libwired/%.o: %.c
@test -d $(@D) || mkdir -p $(@D)
$(COMPILE) -I$(<D) -c $< -o $@
$(objdir)/libwired/%.d: %.c
@test -d $(@D) || mkdir -p $(@D)
($(DEPEND) $< | sed 's,$*.o,$(@D)/&,g'; echo "$@: $<") > $@
$(headerdir)/%.h: %.h
@test -d $(@D) || mkdir -p $(@D)
cp $< $@
test: $(rundir)/test
@MallocStackLogging=1 $(rundir)/test
$(rundir)/test: $(rundir)/lib/libwired.a $(TESTOBJECTS)
@test -d $(@D) || mkdir -p $(@D)
$(LINK) $(TESTOBJECTS) $(LIBS)
ifeq ($(WI_MAINTAINER), 1)
@MallocStackLogging=1 $(rundir)/test
endif
$(objdir)/libwired/test.o: test/testlist.h test/testlist.inc
test/testlist.h: $(TESTSOBJECTS)
-grep -h WI_TEST_EXPORT $(wildcard test/tests/*.c) > $@
test/testlist.inc: test/testlist.h
perl -ne '$$s=(split(/\s+/))[2]; $$s=~ s/(\w+).*/$$1/; print "wi_tests_run_test(\"$$s\", $$s);\n";' $< > $@
dist:
rm -rf libwired-$(WI_VERSION)
rm -f libwired-$(WI_VERSION).tar.gz
mkdir libwired-$(WI_VERSION)
@for i in $(DISTFILES); do \
if [ -e $$i ]; then \
echo cp -LRp $$i libwired-$(WI_VERSION)/$$i; \
cp -LRp $$i libwired-$(WI_VERSION)/$$i; \
fi \
done
$(SHELL) -ec "cd libwired-$(WI_VERSION) && WI_MAINTAINER=0 $(MAKE) -e distclean scmclean"
tar -czf libwired-$(WI_VERSION).tar.gz libwired-$(WI_VERSION)
rm -rf libwired-$(WI_VERSION)
clean:
rm -f $(objdir)/libwired/*.o
rm -f $(objdir)/libwired/*.d
rm -f $(headerdir)/*.h
rm -f $(rundir)/lib/libwired.a
rm -f $(rundir)/test
rm -rf autom4te.cache
distclean: clean
rm -rf $(objdir)/libwired
rm -f Makefile config.h config.log config.status config.cache
rm -f libwired-$(WI_VERSION).tar.gz
scmclean:
find . -name .DS_Store -print0 | xargs -0 rm -f
find . -name CVS -print0 | xargs -0 rm -rf
find . -name .svn -print0 | xargs -0 rm -rf
ifeq ($(WI_MAINTAINER), 1)
-include $(LIBWIREDOBJECTS:.o=.d)
-include $(TESTOBJECTS:.o=.d)
endif