* [gentoo-commits] gentoo-projects commit in portage-utils: Makefile Makefile.am
@ 2011-12-12 21:04 Mike Frysinger (vapier)
0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2011-12-12 21:04 UTC (permalink / raw
To: gentoo-commits
vapier 11/12/12 21:04:23
Modified: Makefile Makefile.am
Log:
first pass at integrating the testsuite into autotools code
Revision Changes Path
1.72 portage-utils/Makefile
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/Makefile?rev=1.72&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/Makefile?rev=1.72&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/Makefile?r1=1.71&r2=1.72
Index: Makefile
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- Makefile 11 Dec 2011 21:38:41 -0000 1.71
+++ Makefile 12 Dec 2011 21:04:23 -0000 1.72
@@ -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 @@
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 @@
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 @@
#####################################################
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 @@
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 @@
-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 @@
$(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 @@
>> Makefile.am
autotools: autotools-update
./autogen.sh --from=make
+
+.PHONY: autotools autotools-update _autotools-update
1.6 portage-utils/Makefile.am
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/Makefile.am?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/Makefile.am?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/Makefile.am?r1=1.5&r2=1.6
Index: Makefile.am
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile.am 12 Dec 2011 20:21:06 -0000 1.5
+++ Makefile.am 12 Dec 2011 21:04:23 -0000 1.6
@@ -4,7 +4,9 @@
bin_PROGRAMS = q
q_SOURCES = main.c
-q_CPPFLAGS = -I$(top_builddir)/autotools/gnulib -I$(top_srcdir)/autotools/gnulib $(foreach a,$(APPLETS),-DAPPLET_$a)
+q_CPPFLAGS = \
+ -I$(top_builddir)/autotools/gnulib \
+ -I$(top_srcdir)/autotools/gnulib
q_LDADD = \
$(top_builddir)/autotools/gnulib/libgnu.a \
$(LIB_CLOCK_GETTIME) \
@@ -16,12 +18,42 @@
[ ! -e "$$applet" ] && ln -s q $${applet} ; \
done
+TMAKE = \
+ $(MAKE) -C $(abs_top_srcdir)/tests \
+ AUTOTOOLS=true \
+ abs_top_builddir="$(abs_top_builddir)" \
+ abs_top_srcdir="$(abs_top_srcdir)"
+check-hook:
+ $(TMAKE) check
+clean-local:
+ $(TMAKE) clean
+ -rmdir tests/*/ tests/
+ rm -f $(APPLETS)
+check: check-hook
+
# Start off with base values which we append below
dist_man_MANS =
APPLETS =
EXTRA_DIST = autotools/m4/gnulib-cache.m4
# @@@ GEN START @@@ #
+q_CPPFLAGS += \
+ -DAPPLET_q \
+ -DAPPLET_qatom \
+ -DAPPLET_qcache \
+ -DAPPLET_qcheck \
+ -DAPPLET_qdepends \
+ -DAPPLET_qfile \
+ -DAPPLET_qgrep \
+ -DAPPLET_qlist \
+ -DAPPLET_qlop \
+ -DAPPLET_qmerge \
+ -DAPPLET_qpkg \
+ -DAPPLET_qsearch \
+ -DAPPLET_qsize \
+ -DAPPLET_qtbz2 \
+ -DAPPLET_quse \
+ -DAPPLET_qxpak
dist_man_MANS += \
man/q.1 \
man/qatom.1 \
@@ -161,5 +193,6 @@
tests/reinitialize/dotest \
tests/source/Makefile \
tests/source/dotest \
- tests/source/space
+ tests/source/space \
+ tests/subdir.mk
# @@@ GEN START @@@ #
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-12-12 21:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 21:04 [gentoo-commits] gentoo-projects commit in portage-utils: Makefile Makefile.am Mike Frysinger (vapier)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox