# 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 "*.c"))))) TESTOBJECTS = $(addprefix $(objdir)/libwired/,$(notdir $(patsubst %.c,%.o,$(shell find $(abs_top_srcdir)/test -name "*.c")))) TESTSOBJECTS = $(addprefix $(objdir)/libwired/,$(notdir $(patsubst %.c,%.o,$(shell find $(abs_top_srcdir)/test/tests -name "*.c")))) HEADERS = $(addprefix $(headerdir)/,$(notdir $(shell find $(abs_top_srcdir)/libwired -name "*.h"))) DEFS = @DEFS@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = -L$(rundir)/lib @LDFLAGS@ LIBS = -lwired @LIBS@ INCLUDES = -I$(abs_top_srcdir) -I$(rundir)/include 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 all: $(rundir)/lib/libwired.a ifeq ($(WI_MAINTAINER), 1) all: Makefile configure config.h.in $(rundir)/test 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$( $@ $(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