From: Nick Bowler Date: Fri, 11 May 2012 01:53:19 +0000 (-0400) Subject: build: Non-recursively build the rest of the package. X-Git-Url: https://git.draconx.ca/gitweb/upkg.git/commitdiff_plain/dfa9938398a0e862430cc1e7f708962da1e67d8f build: Non-recursively build the rest of the package. --- diff --git a/.gitignore b/.gitignore index f6ee610..dd4c212 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.o *.lo *.la +*.gobstamp Makefile Makefile.in .libs @@ -22,4 +23,5 @@ Makefile.in /libuobject.pc /lib /snippet +/upkg /test-suite.log diff --git a/Makefile.am b/Makefile.am index 63b5927..58f0e6c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -# Copyright © 2009 Nick Bowler +# Copyright © 2009-2012 Nick Bowler # # License WTFPL2: Do What The Fuck You Want To Public License, version 2. # This is free software: you are free to do what the fuck you want to. @@ -6,24 +6,79 @@ AUTOMAKE_OPTIONS = parallel-tests color-tests ACLOCAL_AMFLAGS = -I m4 - -CLEANFILES = +MAINTAINERCLEANFILES = MOSTLYCLEANFILES = -include_HEADERS = -lib_LTLIBRARIES = +CLEANFILES = + +EXTRA_DIST = $(MAINTAINERCLEANFILES) m4/gnulib-cache.m4 + +AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/lib -I$(top_srcdir)/lib \ + -DPKGLIBDIR=\"$(pkglibdir)\" -DPKGDATADIR=\"$(pkgdatadir)\" + +AM_CFLAGS = $(LTDLINCL) $(GLIB_CFLAGS) $(LIBMODPLUG_CFLAGS) + +bin_PROGRAMS = upkg +lib_LTLIBRARIES = libupkg.la libuobject.la +pkglib_LTLIBRARIES = engine.la noinst_LTLIBRARIES = EXTRA_LTLIBRARIES = +include_HEADERS = + +dist_man_MANS = doc/man/upkg.1 -AM_CPPFLAGS = -I$(top_srcdir)/src +# This trick should define orderonly to | iff we're using GNU make. +have_orderonly = $(findstring order-only,$(.FEATURES)) +orderonly = $(have_orderonly:order-only=|) -EXTRA_DIST = m4/gnulib-cache.m4 +upkg_SOURCES = src/upkg.c +upkg_LDFLAGS = $(AM_LDFLAGS) -export-dynamic +upkg_LDADD = libuobject.la libupkg.la libgnu.la $(GLIB_LIBS) +$(upkg_OBJECTS): $(gnulib_headers) -dist_man_MANS = doc/man/upkg.1 +libupkg_la_SOURCES = src/libupkg.c src/pack.c + +uobjectdir = $(includedir)/uobject +uobject_HEADERS = src/uobject/uobject.h src/uobject/exportable.h \ + src/uobject/loadable.h src/uobject/module.h src/uobject/package.h \ + src/uobject/vfs.h -SUBDIRS = . src +libuobject_la_SOURCES = src/uobject/uobject.c src/uobject/module.c \ + src/uobject/avl.c src/uobject/avl.h src/uobject/package.c \ + src/uobject/exportable.c src/uobject/loadable.c src/uobject/vfs.c +libuobject_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^u_' +libuobject_la_LIBADD = libgnu.la $(LIBLTDL) $(GLIB_LIBS) +$(libuobject_la_OBJECTS): $(gnulib_headers) + +libuobject_la = libuobject.la +$(libuobject_la): $(LTDLDEPS) + +moduleflags = -module -avoid-version -export-symbols-regex _LTX_ + +engine_GOBS = src/engine/palette.gob src/engine/texture.gob \ + src/engine/music.gob + +MAINTAINERCLEANFILES += $(engine_GOBS:.gob=.gobstamp) \ + $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h) + +engine_la_SOURCES = $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h) \ + src/engine/engine.c src/engine/pcx.c +engine_la_LDFLAGS = $(AM_LDFLAGS) $(moduleflags) +engine_la_LIBADD = $(GLIB_LIBS) +$(engine_la_OBJECTS): $(orderonly) $(engine_GOBS:.gob=.gobstamp) + +if USE_DUMMYMOD +engine_la_SOURCES += src/engine/music-dummymod.c +endif + +if USE_LIBMODPLUG +engine_la_SOURCES += src/engine/music-modplug.c src/engine/modplug-types.h +engine_la_LIBADD += $(LIBMODPLUG_LIBS) +endif check_PROGRAMS = test/decodeindex test_decodeindex_LDADD = src/libupkg.la libgnu.la +$(test_decodeinder_OBJECTS): $(gnulib_headers) TESTS_ENVIRONMENT = SHELL='$(SHELL)' EXEEXT='$(EXEEXT)' TEST_EXTENSIONS = .sh @@ -32,6 +87,23 @@ SH_LOG_COMPILER = $(SHELL) TESTS = tests/libupkg-index-decode.sh EXTRA_DIST += $(TESTS) +# Supporting rules for GObject Builder +GOB_V = $(GOB_V_$(V)) +GOB_V_ = $(GOB_V_$(AM_DEFAULT_VERBOSITY)) +GOB_V_0 = @echo " GOB " $<; + +# Unfortunately, GOB's output filenames depend on the contents of the gob file, +# rather than its filename. This isn't really suitable for use with make, so +# this rule has to make some assumptions about the source tree layout. +.gob.gobstamp: + $(GOB_V) $(GOB2) -o src --file-sep=/ --no-private-header $< + $(AM_V_at) touch $@ + +STAMP_RECOVER = \ + @if test -f $@; then :; else rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; fi +.gobstamp.c: ; $(STAMP_RECOVER) +.gobstamp.h: ; $(STAMP_RECOVER) + include $(top_srcdir)/lib/gnulib.mk if BUNDLED_LIBLTDL include $(top_srcdir)/libltdl/ltdl.mk diff --git a/configure.ac b/configure.ac index 0a4b6f4..48ccbb2 100644 --- a/configure.ac +++ b/configure.ac @@ -65,7 +65,6 @@ GOB2_CHECK([2.0.0]) AC_CONFIG_FILES([ Makefile - src/Makefile libuobject.pc ]) AC_OUTPUT diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 5f1347e..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.gobstamp -/upkg diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 5a0b682..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2009-2011 Nick Bowler -# -# License WTFPL2: Do What The Fuck You Want To Public License, version 2. -# This is free software: you are free to do what the fuck you want to. -# There is NO WARRANTY, to the extent permitted by law. - -AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib -AM_LDFLAGS = -L$(top_builddir)/lib - -EXTRA_DIST = -MAINTAINERCLEANFILES = - -lib_LTLIBRARIES = libupkg.la -pkglib_LTLIBRARIES = - -include_HEADERS = upkg.h -noinst_HEADERS = pack.h - -# This trick should define orderonly to | iff we're using GNU make. -have_orderonly = $(findstring order-only,$(.FEATURES)) -orderonly = $(have_orderonly:order-only=|) - -include uobject/Makefile.inc -include engine/Makefile.inc - -libupkg_la_SOURCES = libupkg.c pack.c - -bin_PROGRAMS = upkg -upkg_SOURCES = upkg.c -upkg_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) -upkg_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -upkg_LDADD = libuobject.la libupkg.la $(GLIB_LIBS) $(top_builddir)/libgnu.la - -GOB_V = $(GOB_V_$(V)) -GOB_V_ = $(GOB_V_$(AM_DEFAULT_VERBOSITY)) -GOB_V_0 = @echo " GOB " $<; - -.gob.gobstamp: - $(AM_V_at) touch $@.tmp - $(GOB_V) $(GOB2) --file-sep=/ --no-private-header $< - $(AM_V_at) mv -f $@.tmp $@ - -.gobstamp.c: - @if test -f $@; then :; else \ - rm -f $<; \ - $(MAKE) $(AM_MAKEFLAGS) $<; \ - fi - -.gobstamp.h: - @if test -f $@; then :; else \ - rm -f $<; \ - $(MAKE) $(AM_MAKEFLAGS) $<; \ - fi diff --git a/src/engine/Makefile.inc b/src/engine/Makefile.inc deleted file mode 100644 index 574bca0..0000000 --- a/src/engine/Makefile.inc +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright © 2009-2011 Nick Bowler -# -# License WTFPL2: Do What The Fuck You Want To Public License, version 2. -# This is free software: you are free to do what the fuck you want to. -# There is NO WARRANTY, to the extent permitted by law. - -noinst_HEADERS += engine/music-module.h engine/pcx.h - -engine_GOBS = engine/palette.gob engine/texture.gob engine/music.gob - -EXTRA_DIST += $(engine_GOBS) $(engine_GOBS:.gob=.gobstamp) -noinst_HEADERS += $(engine_GOBS:.gob=.h) -MAINTAINERCLEANFILES += $(engine_GOBS:.gob=.gobstamp) \ - $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h) - -pkglib_LTLIBRARIES += engine.la -engine_la_SOURCES = engine/engine.c engine/pcx.c $(engine_GOBS:.gob=.c) -engine_la_CFLAGS = $(GLIB_CFLAGS) -engine_la_LIBADD = $(GLIB_LIBS) -engine_la_LDFLAGS = -module -avoid-version -export-symbols-regex _LTX_ - -# Force all GOB objects to be generated before building anything. -$(engine_la_OBJECTS): $(orderonly) $(engine_GOBS:.gob=.gobstamp) - -if USE_DUMMYMOD -engine_la_SOURCES += engine/music-dummymod.c -endif - -if USE_LIBMODPLUG -engine_la_SOURCES += engine/music-modplug.c engine/modplug-types.h -engine_la_CFLAGS += $(LIBMODPLUG_CFLAGS) -engine_la_LIBADD += $(LIBMODPLUG_LIBS) -endif diff --git a/src/uobject/Makefile.inc b/src/uobject/Makefile.inc deleted file mode 100644 index f3e4cbd..0000000 --- a/src/uobject/Makefile.inc +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright © 2009 Nick Bowler -# -# License WTFPL2: Do What The Fuck You Want To Public License, version 2. -# This is free software: you are free to do what the fuck you want to. -# There is NO WARRANTY, to the extent permitted by law. - -lib_LTLIBRARIES += libuobject.la - -uobjectdir = $(includedir)/uobject -uobject_HEADERS = uobject/uobject.h uobject/exportable.h uobject/loadable.h \ - uobject/module.h uobject/package.h uobject/vfs.h -noinst_HEADERS += uobject/avl.h - -libuobject_la_SOURCES = uobject/uobject.c uobject/module.c uobject/avl.c \ - uobject/package.c uobject/loadable.c uobject/exportable.c \ - uobject/vfs.c -libuobject_la_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(LTDLINCL) \ - -DPKGLIBDIR=\"$(pkglibdir)\" -DPKGDATADIR=\"$(pkgdatadir)\" -libuobject_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^u_' -libuobject_la_LIBADD = $(LIBLTDL) $(GLIB_LIBS) $(top_builddir)/libgnu.la