forked from ccache/ccache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
158 lines (128 loc) · 3.62 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
srcdir = @srcdir@
builddir = @builddir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
datarootdir = @datarootdir@
sysconfdir = @sysconfdir@
installcmd = @INSTALL@
AR = @AR@
BASH = @BASH@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
EXEEXT = @EXEEXT@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
RANLIB = @RANLIB@
all_cflags = $(CFLAGS)
all_cppflags = @DEFS@ -DSYSCONFDIR=$(sysconfdir) -I. -I$(srcdir)/src -I$(builddir)/unittest $(CPPFLAGS)
extra_libs = @extra_libs@
non_3pp_sources = \
src/args.c \
src/ccache.c \
src/cleanup.c \
src/compopt.c \
src/conf.c \
src/counters.c \
src/execute.c \
src/exitfn.c \
src/hash.c \
src/hashutil.c \
src/language.c \
src/lockfile.c \
src/manifest.c \
src/mdfour.c \
src/stats.c \
src/unify.c \
src/util.c
generated_sources = \
src/version.c
3pp_sources = \
src/getopt_long.c \
src/hashtable.c \
src/hashtable_itr.c \
src/murmurhashneutral2.c \
src/snprintf.c
base_sources = $(non_3pp_sources) $(generated_sources) $(3pp_sources)
base_objs = $(base_sources:.c=.o)
ccache_sources = src/main.c $(base_sources)
ccache_objs = $(ccache_sources:.c=.o)
zlib_sources = \
src/zlib/adler32.c \
src/zlib/crc32.c \
src/zlib/deflate.c \
src/zlib/gzclose.c \
src/zlib/gzlib.c \
src/zlib/gzread.c \
src/zlib/gzwrite.c \
src/zlib/inffast.c \
src/zlib/inflate.c \
src/zlib/inftrees.c \
src/zlib/trees.c \
src/zlib/zutil.c
zlib_objs = $(zlib_sources:.c=.o)
test_suites = @test_suites@
test_sources = unittest/main.c unittest/framework.c unittest/util.c
test_sources += $(test_suites)
test_objs = $(test_sources:.c=.o)
all_sources = $(ccache_sources) $(test_sources)
all_objs = $(ccache_objs) $(test_objs) $(zlib_objs)
files_to_clean = \
$(all_objs) \
ccache$(EXEEXT) \
src/*~ \
src/zlib/libz.a \
testdir.* \
unittest/run$(EXEEXT) \
*~
files_to_distclean = Makefile config.h config.log config.status
.PHONY: all
all: ccache$(EXEEXT)
ccache$(EXEEXT): $(ccache_objs) $(extra_libs)
$(CC) $(all_cflags) -o $@ $(ccache_objs) $(LDFLAGS) $(extra_libs) $(LIBS)
ccache.1: doc/ccache.1
cp $< $@
.PHONY: install
install: ccache$(EXEEXT) @[email protected]
$(installcmd) -d $(DESTDIR)$(bindir)
$(installcmd) -m 755 ccache$(EXEEXT) $(DESTDIR)$(bindir)
@disable_man@ $(installcmd) -d $(DESTDIR)$(mandir)/man1
@disable_man@ -$(installcmd) -m 644 ccache.1 $(DESTDIR)$(mandir)/man1/
.PHONY: clean
clean:
rm -rf $(files_to_clean)
conf.c: confitems_lookup.c envtoconfitems_lookup.c
$(zlib_objs): CPPFLAGS += -include config.h
src/zlib/libz.a: $(zlib_objs)
$(AR) cr $@ $(zlib_objs)
$(RANLIB) $@
.PHONY: perf
perf: ccache$(EXEEXT)
$(srcdir)/perf/perf.py --ccache ccache$(EXEEXT) $(CC) $(all_cppflags) $(all_cflags) $(srcdir)/src/ccache.c
.PHONY: test
test: ccache$(EXEEXT) unittest/run$(EXEEXT)
unittest/run$(EXEEXT)
CC='$(CC)' $(BASH) $(srcdir)/test/run
.PHONY: unittest
unittest: unittest/run$(EXEEXT)
unittest/run$(EXEEXT)
unittest/run$(EXEEXT): $(base_objs) $(test_objs) $(extra_libs)
$(CC) $(all_cflags) -o $@ $(base_objs) $(test_objs) $(LDFLAGS) $(extra_libs) $(LIBS)
unittest/main.o: unittest/suites.h
unittest/suites.h: $(test_suites) Makefile
ls $^ | grep -v Makefile | xargs sed -n 's/TEST_SUITE(\(.*\))/SUITE(\1)/p' >$@
.PHONY: check
check: test
.PHONY: distclean
distclean: clean
rm -rf $(files_to_distclean)
.PHONY: installcheck
installcheck: ccache$(EXEEXT) unittest/run$(EXEEXT)
unittest/run$(EXEEXT)
CCACHE=$(bindir)/ccache CC='$(CC)' $(BASH) $(srcdir)/test/run
.c.o:
$(CC) $(all_cppflags) $(all_cflags) -c -o $@ $<
@include_dev_mk@