ccache/Makefile.in

93 lines
2.2 KiB
Makefile

srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
datarootdir = @datarootdir@
installcmd = @INSTALL@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir)
LDFLAGS = @LDFLAGS@
EXEEXT = @EXEEXT@
libs = @LIBS@ -lm
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
base_objs = $(base_sources:.c=.o)
ccache_sources = main.c $(base_sources) @extra_sources@
ccache_objs = $(ccache_sources:.c=.o)
test_suites = util
test_suite_files = $(test_suites:%=$(srcdir)/test/test_%.c)
test_sources = test/main.c test/framework.c $(test_suite_files)
test_objs = $(test_sources:.c=.o)
all_sources = $(ccache_sources) $(test_sources)
all_objs = $(ccache_objs) $(test_objs)
generated_docs = ccache.1 INSTALL.html manual.html NEWS.html README.html
files_to_clean = $(all_objs) ccache$(EXEEXT) test/main$(EXEEXT) *~
.PHONY: all
all: ccache$(EXEEXT)
.PHONY: docs
docs: $(generated_docs)
ccache$(EXEEXT): $(ccache_objs)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(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)
.PHONY: perf
perf: ccache$(EXEEXT)
$(srcdir)/perf.py --ccache ccache$(EXEEXT) $(CC) $(CFLAGS) $(CPPFLAGS) $(srcdir)/ccache.c
.PHONY: test
test: ccache$(EXEEXT) test/main$(EXEEXT)
test/main$(EXEEXT)
CC='$(CC)' $(srcdir)/test.sh
test/main$(EXEEXT): $(base_objs) $(test_objs)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(libs)
test/main.o: test/suites.h
test/suites.h: $(test_suite_files) Makefile
sed -n 's/TEST_SUITE(\(.*\))/SUITE(\1)/p' $(test_suite_files) >$@
.PHONY: check
check: test
.PHONY: distclean
distclean: clean
rm -rf Makefile dev.mk config.h config.log config.status .deps version.c
.PHONY: installcheck
installcheck: ccache$(EXEEXT) test/main$(EXEEXT)
test/main$(EXEEXT)
CCACHE=$(bindir)/ccache CC='$(CC)' $(srcdir)/test.sh
.c.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
@include_dev_mk@