diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-12-12 21:04:23 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-12-12 21:04:23 +0000 |
commit | 689bf367a25ff2522e4c547ae11b6fb0d7bb7d03 (patch) | |
tree | 652da35b13e47965f8098b9c44e654171c019061 /Makefile | |
parent | Fixed compilation on Darwin by solving GNUlib st_mtim problem (diff) | |
download | portage-utils-689bf367a25ff2522e4c547ae11b6fb0d7bb7d03.tar.gz portage-utils-689bf367a25ff2522e4c547ae11b6fb0d7bb7d03.tar.bz2 portage-utils-689bf367a25ff2522e4c547ae11b6fb0d7bb7d03.zip |
first pass at integrating the testsuite into autotools code
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 36 |
1 files changed, 24 insertions, 12 deletions
@@ -1,6 +1,6 @@ # Copyright 2005-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v 1.71 2011/12/11 21:38:41 vapier Exp $ +# $Header: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v 1.72 2011/12/12 21:04:23 vapier Exp $ #################################################################### check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ @@ -16,6 +16,7 @@ WFLAGS := -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \ CFLAGS ?= -O2 -g -pipe CFLAGS += -std=gnu99 +CPPFLAGS ?= #CFLAGS += -DEBUG -g #CFLAGS += -Os -DOPTIMIZE_FOR_SIZE=2 -falign-functions=2 -falign-jumps=2 -falign-labels=2 -falign-loops=2 #LDFLAGS := -pie @@ -26,8 +27,13 @@ STRIP := strip MKDIR := mkdir -p CP := cp +ifndef V +Q = @ +else +Q = +endif ifdef PV -HFLAGS += -DVERSION=\"$(PV)\" +CPPFLAGS += -DVERSION=\"$(PV)\" else PV := cvs endif @@ -44,7 +50,8 @@ DOCS := TODO README qsync ##################################################### APPLETS := $(shell sed -n '/^DECLARE_APPLET/s:.*(\(.*\))$$:\1:p' applets.h|sort) SRC := $(APPLETS:%=%.c) main.c -HFLAGS += $(foreach a,$(APPLETS),-DAPPLET_$a) +APP_FLAGS := $(foreach a,$(APPLETS),-DAPPLET_$a) +CPPFLAGS += $(APP_FLAGS) all: q @true @@ -55,21 +62,18 @@ debug: q: $(SRC) libq/*.c *.h libq/*.h ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS)) - @echo $(foreach a,$(APPLETS), : $a) : + @printf ': %s ' $(APPLETS) + @echo ':' ifndef V @echo $(CC) $(CFLAGS) $(PYFLAGS) $(LDFLAGS) main.c -o q $(LIBADD) endif endif -ifndef V - @$(CC) $(WFLAGS) $(PYFLAGS) $(LDFLAGS) $(CFLAGS) $(HFLAGS) main.c -o q $(LIBADD) -else - $(CC) $(WFLAGS) $(PYFLAGS) $(LDFLAGS) $(CFLAGS) $(HFLAGS) main.c -o q $(LIBADD) -endif + $(Q)$(CC) $(WFLAGS) $(PYFLAGS) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) main.c -o q $(LIBADD) .depend: $(SRC) sed -n '/^DECLARE_APPLET/s:.*(\(.*\)).*:#include "\1.c":p' applets.h > include_applets.h @#$(CC) $(CFLAGS) -MM $(SRC) > .depend - $(CC) $(HFLAGS) $(CFLAGS) -MM main.c > .depend + $(CC) $(CPPFLAGS) $(CFLAGS) -MM main.c > .depend check: symlinks $(MAKE) -C tests $@ @@ -120,7 +124,7 @@ symlinks: all -include .depend -.PHONY: all autotools check clean debug dist distclean install man symlinks testclean +.PHONY: all check clean debug dist distclean install man symlinks testclean # # All logic related to autotools is below here @@ -134,9 +138,15 @@ EXTRA_DIST = \ $(shell find tests -type f '!' -ipath '*/CVS/*') MAKE_MULTI_LINES = $(patsubst %,\\\\\n\t%,$(sort $(1))) autotools-update: + $(MAKE) -C tests clean + $(MAKE) _autotools-update +# 2nd level of indirection here is so the $(find) doesn't pick up +# files in EXTRA_DIST that get cleaned up ... +_autotools-update: sed -i '/^$(GEN_MARK_START)$$/,/^$(GEN_MARK_END)$$/d' Makefile.am - printf '%s\ndist_man_MANS += %b\nAPPLETS += %b\nEXTRA_DIST += %b\n%s\n' \ + printf '%s\nq_CPPFLAGS += %b\ndist_man_MANS += %b\nAPPLETS += %b\nEXTRA_DIST += %b\n%s\n' \ "$(GEN_MARK_START)" \ + "$(call MAKE_MULTI_LINES,$(APP_FLAGS))" \ "$(call MAKE_MULTI_LINES,$(wildcard man/*.1))" \ "$(call MAKE_MULTI_LINES,$(APPLETS))" \ "$(call MAKE_MULTI_LINES,$(EXTRA_DIST))" \ @@ -144,3 +154,5 @@ autotools-update: >> Makefile.am autotools: autotools-update ./autogen.sh --from=make + +.PHONY: autotools autotools-update _autotools-update |