From 3e0b6fdff4b3707d51528f1a719cc0ec0ec3f455 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 11 Dec 2015 20:04:31 -0500 Subject: [PATCH] Re-established the test build. --- build/GNUbasegcc.mk | 2 ++ build/GNUmakefile.test | 25 +++++++++++++++++++ buildnotes | 2 ++ oldbuild/GNUmakefile.test | 21 ---------------- .../test/GNUmakeinc.mk => test/GNUfiles.mk | 0 5 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 build/GNUmakefile.test delete mode 100644 oldbuild/GNUmakefile.test rename oldbuild/test/GNUmakeinc.mk => test/GNUfiles.mk (100%) diff --git a/build/GNUbasegcc.mk b/build/GNUbasegcc.mk index 8190e214..cb1ee524 100644 --- a/build/GNUbasegcc.mk +++ b/build/GNUbasegcc.mk @@ -1,5 +1,7 @@ # 16 october 2015 +# TODO the loader looks for the soname, not the base name, which is frustrating + # Global flags. CFLAGS += \ diff --git a/build/GNUmakefile.test b/build/GNUmakefile.test new file mode 100644 index 00000000..1ff3852d --- /dev/null +++ b/build/GNUmakefile.test @@ -0,0 +1,25 @@ +# 16 october 2015 + +ifndef inlibuibuild +$(error Do not run these makefiles directly.) +endif + +include $(OS)/GNUosspecific.mk +include test/GNUfiles.mk + +HFILES += \ + ui.h + +NAME = test +SUFFIX = $(EXESUFFIX) + +ifeq ($(TOOLCHAIN),gcc) + LDFLAGS += -L$(OUTDIR) -lui + # tell the dynamic loader to search in the executable path for shared objects + LDFLAGS += -Wl,-rpath='$$ORIGIN' +else + # TODO is there an equivalent to -L? + LDFLAGS += $(OUTDIR)/libui.lib +endif + +include build/GNUbase$(TOOLCHAIN).mk diff --git a/buildnotes b/buildnotes index f8bd1582..0ea8df94 100644 --- a/buildnotes +++ b/buildnotes @@ -34,3 +34,5 @@ To build an example, use make EXAMPLE=name [variables...] example You must specify the example name. + +TODO discuss the internals diff --git a/oldbuild/GNUmakefile.test b/oldbuild/GNUmakefile.test deleted file mode 100644 index c074b892..00000000 --- a/oldbuild/GNUmakefile.test +++ /dev/null @@ -1,21 +0,0 @@ -# 16 october 2015 - -ifndef inlibuibuild -$(error [FAIL] do not run these makefiles directly) -endif - -include $(OS)/GNUosspecific.mk -include test/GNUmakeinc.mk - -HFILES += \ - ui.h - -NAME = test - -SUFFIX = $(EXESUFFIX) - -# TODO what's the difference between doing this and linking to out/libui.so directly? -# LDFLAGS += -L$(OUTDIR) -lui -LDFLAGS += $(OUTDIR)/libui$(LIBSUFFIX) - -include GNUbaserules.mk diff --git a/oldbuild/test/GNUmakeinc.mk b/test/GNUfiles.mk similarity index 100% rename from oldbuild/test/GNUmakeinc.mk rename to test/GNUfiles.mk