forked from ccache/ccache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
111 lines (85 loc) · 2.91 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
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
datarootdir = @datarootdir@
sysconfdir = @sysconfdir@
installcmd = @INSTALL@
AR = @AR@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
EXEEXT = @EXEEXT@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
RANLIB = @RANLIB@
all_cflags = $(CFLAGS)
all_cppflags = @DEFS@ @extra_cppflags@ -DSYSCONFDIR=$(sysconfdir) -I. -I$(srcdir) $(CPPFLAGS)
all_ldflags = @extra_ldflags@ $(LDFLAGS)
extra_libs = @extra_libs@
base_sources = \
ccache.c mdfour.c hash.c execute.c util.c args.c stats.c version.c \
cleanup.c snprintf.c unify.c manifest.c hashtable.c hashtable_itr.c \
murmurhashneutral2.c hashutil.c getopt_long.c exitfn.c lockfile.c \
counters.c language.c compopt.c conf.c
base_objs = $(base_sources:.c=.o)
ccache_sources = main.c $(base_sources)
ccache_objs = $(ccache_sources:.c=.o)
zlib_sources = \
zlib/adler32.c zlib/crc32.c zlib/deflate.c zlib/gzclose.c zlib/gzlib.c \
zlib/gzread.c zlib/gzwrite.c zlib/inffast.c zlib/inflate.c \
zlib/inftrees.c zlib/trees.c zlib/zutil.c
zlib_objs = $(zlib_sources:.c=.o)
test_suites = @test_suites@
test_sources = test/main.c test/framework.c test/util.c $(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) test/main$(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) $(all_ldflags) $(extra_libs) $(LIBS)
.PHONY: install
install: all
$(installcmd) -d $(DESTDIR)$(bindir)
$(installcmd) -m 755 ccache$(EXEEXT) $(DESTDIR)$(bindir)
$(installcmd) -d $(DESTDIR)$(mandir)/man1
-$(installcmd) -m 644 $(srcdir)/ccache.1 $(DESTDIR)$(mandir)/man1/
.PHONY: clean
clean:
rm -f $(files_to_clean)
conf.c: confitems_lookup.c envtoconfitems_lookup.c
zlib/libz.a: $(zlib_objs)
$(AR) cr $@ $(zlib_objs)
$(RANLIB) $@
.PHONY: perf
perf: ccache$(EXEEXT)
$(srcdir)/perf.py --ccache ccache$(EXEEXT) $(CC) $(all_cppflags) $(all_cflags) $(srcdir)/ccache.c
.PHONY: test
test: ccache$(EXEEXT) test/main$(EXEEXT)
test/main$(EXEEXT)
CC='$(CC)' $(srcdir)/test.sh
.PHONY: quicktest
quicktest: test/main$(EXEEXT)
test/main$(EXEEXT)
test/main$(EXEEXT): $(base_objs) $(test_objs) $(extra_libs)
$(CC) $(all_cflags) -o $@ $(base_objs) $(test_objs) $(all_ldflags) $(extra_libs) $(LIBS)
test/main.o: test/suites.h
test/suites.h: $(test_suites) Makefile
sed -n 's/TEST_SUITE(\(.*\))/SUITE(\1)/p' $(test_suites) >$@
.PHONY: check
check: test
.PHONY: distclean
distclean: clean
rm -rf $(files_to_distclean)
.PHONY: installcheck
installcheck: ccache$(EXEEXT) test/main$(EXEEXT)
test/main$(EXEEXT)
CCACHE=$(bindir)/ccache CC='$(CC)' $(srcdir)/test.sh
.c.o:
$(CC) $(all_cppflags) $(all_cflags) -c -o $@ $<
@include_dev_mk@