From 49049beb9142a24891e1f703fdc5f0050ddc9efa Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 10 Dec 2015 19:08:26 -0500 Subject: [PATCH] Started the new build system, with full documentation. --- newbuild/GNUmakefile | 60 ++++++++++++++++++++++++++++++++++++++++++++ newbuild/notes | 36 ++++++++++++++++++++++++++ oldbuild/GNUmakefile | 35 -------------------------- 3 files changed, 96 insertions(+), 35 deletions(-) create mode 100644 newbuild/GNUmakefile create mode 100644 newbuild/notes delete mode 100644 oldbuild/GNUmakefile diff --git a/newbuild/GNUmakefile b/newbuild/GNUmakefile new file mode 100644 index 00000000..364c9da9 --- /dev/null +++ b/newbuild/GNUmakefile @@ -0,0 +1,60 @@ +# 16 october 2015 + +# silence entering/leaving messages +MAKEFLAGS += --no-print-directory + +OUTDIR = out +OBJDIR = .obj + +# MAME does this so :/ +ifeq ($(OS),Windows_NT) + OS = windows +endif + +ifndef OS + UNAME = $(shell uname -s) + ifeq ($(UNAME),Darwin) + OS = darwin + else ifeq ($(UNAME),Haiku) + OS = haiku + else + OS = unix + endif +endif + +# default is to build with debug symbols +ifndef NODEBUG + NODEBUG = 0 +endif + +# TODO $(CC), $(CXX)? if so, $(LD)? +# TODO quotes for the FLAGS options? +ARGS = \ + OS=$(OS) \ + OUTDIR=$(OUTDIR) \ + OBJDIR=$(OBJDIR) \ + CFLAGS=$(CFLAGS) \ + CXXFLAGS=$(CXXFLAGS) \ + LDFLAGS=$(LDFLAGS) \ + NODEBUG=$(NODEBUG) \ + inlibuibuild=1 + +real: + @echo $(MAKE) + @echo $(ARGS) + +libui: + @$(MAKE) -f build/GNUmakefile.libui $(ARGS) + +clean: + rm -rf $(OBJDIR) $(OUTDIR) + +test: libui + @$(MAKE) -f build/GNUmakefile.test $(ARGS) + +# TODO provide a build option for the queuemaintest + +example: libui + @$(MAKE) -f build/GNUmakefile.example $(ARGS) EXAMPLE=$(EXAMPLE) + +# TODO examples rule? diff --git a/newbuild/notes b/newbuild/notes new file mode 100644 index 00000000..f8bd1582 --- /dev/null +++ b/newbuild/notes @@ -0,0 +1,36 @@ +HOW TO BUILD +Simply type + + make [variables...] + +The build-time settings are + + OS=xxx + default operating system + supported OSs are + windows + unix + darwin + haiku + this is autodetected by default + CFLAGS=xxx + CXXFLAGS=xxx + LDFLAGS=xxx + compiler flags + this is where you can specify -m32 or -m64, for instance + Objective-C uses $(CFLAGS) + NODEBUG=xxx + set to 1 to disable debug symbols + must be 1, any other value means "include debug symbols" + +To build the test program use + + make [variables....] test + +The variables are the same as above. + +To build an example, use + + make EXAMPLE=name [variables...] example + +You must specify the example name. diff --git a/oldbuild/GNUmakefile b/oldbuild/GNUmakefile deleted file mode 100644 index 934cc6bd..00000000 --- a/oldbuild/GNUmakefile +++ /dev/null @@ -1,35 +0,0 @@ -# 16 october 2015 - -# TODO warn on MinGW-w64 builds that lack of isolation awareness means no theming - -# silence entering/leaving messages -MAKEFLAGS += --no-print-directory - -OUTDIR = out -OBJDIR = .obj - -# MAME does this so :/ -ifeq ($(OS),Windows_NT) - OS = windows -endif - -ifndef OS - UNAME = $(shell uname -s) - ifeq ($(UNAME),Darwin) - OS = darwin - else ifeq ($(UNAME),Haiku) - OS = haiku - else - OS = unix - endif -endif - -libui: - @$(MAKE) -f GNUmakefile.libui OS=$(OS) OUTDIR=$(OUTDIR) OBJDIR=$(OBJDIR) inlibuibuild=1 - -# TODO why is this not a regular old rule -clean: - @$(MAKE) -f GNUmakefile.libui OS=$(OS) OUTDIR=$(OUTDIR) OBJDIR=$(OBJDIR) inlibuibuild=1 clean - -test: libui - @$(MAKE) -f GNUmakefile.test OS=$(OS) OUTDIR=$(OUTDIR) OBJDIR=$(OBJDIR) inlibuibuild=1