changeset 2:9a8355b47e1c

Various improvements in the build system to add granularity for building different parts of the engine and tools.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 28 Sep 2012 02:20:31 +0300
parents 6e169d87d963
children 82fc316e70d0
files Makefile.gen config.mak.in
diffstat 2 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.gen	Fri Sep 28 02:08:17 2012 +0300
+++ b/Makefile.gen	Fri Sep 28 02:20:31 2012 +0300
@@ -7,6 +7,9 @@
 EXTRA_CFLAGS=-march=core2
 endif
 
+ifneq ($(DMLIB),)
+DM_CFLAGS += -I$(DMLIB)
+endif
 
 ###
 ### Form additional compilation defines based on settings
@@ -34,8 +37,10 @@
 DM_CFLAGS += -DDMRES_PACKFS
 DMLIB_OBJS += dmpack.o dmpackutil.o
 DM_LDFLAGS += -lz
+ifeq ($(DM_BUILD_TOOLS),yes)
 BINARIES += packed
 endif
+endif
 
 ifeq ($(DMRES_STDIO),yes)
 DM_CFLAGS += -DDMRES_STDIO
@@ -65,10 +70,12 @@
 DM_CFLAGS += -DDM_GFX_TTF_TEXT
 DMLIB_OBJS += dmtext.o
 
+ifeq ($(DM_BUILD_TESTS),yes)
 ifeq ($(DM_GFX_BLITS),yes)
 BINARIES += blittest vview vptest efu
 endif
 endif
+endif
 
 ifeq ($(DM_GFX_8BIT),yes)
 DM_CFLAGS += -DDM_GFX_8BIT
@@ -123,7 +130,7 @@
 endif
 
 ifeq ($(DM_USE_C),yes)
-TARGETS += jmix_c.c
+TARGETS += $(DMLIB)jmix_c.c
 DMLIB_OBJS+=jmix_c.o
 
 endif
@@ -134,16 +141,20 @@
 
 
 ### Dependancies
+ifeq ($(DM_BUILD_TOOLS),yes)
+ifeq ($(DMRES_STDIO),yes)
 ifeq ($(SUP_MODLOAD),yes)
 BINARIES+= viewmod mod2wav testpl
 endif
 
-
 ifeq ($(JSS_SUP_JSSMOD),yes)
 ifeq ($(JSS_SUP_XM),yes)
 BINARIES+= xm2jss
 endif
 endif
+endif
+endif
+
 
 endif
 
@@ -161,7 +172,9 @@
 DMLIB_OBJS += dmfile.o dmlib.o dmlerp.o dmstring.o \
 	dmargs.o dmvecmat.o dmperlin.o dmimage.o dmres.o
 
+ifeq ($(DM_BUILD_TESTS),yes)
 BINARIES += vecmattest fptest
+endif
 
 TARGETS += $(DMLIB_A) $(addprefix $(BINPATH),$(addsuffix $(EXEEXT),$(BINARIES)))
 
@@ -205,7 +218,7 @@
 	@$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS)
 
 
-$(DMLIB_A): $(addprefix $(OBJPATH),$(DMLIB_OBJS)) Makefile.gen config.mak
+$(DMLIB_A): $(addprefix $(OBJPATH),$(DMLIB_OBJS)) $(DMLIB)Makefile.gen config.mak
 	@echo " AR $@ $(addprefix $(OBJPATH),$(DMLIB_OBJS))"
 	@$(AR) cru $@ $+ $(addprefix $(OBJPATH),$(DMLIB_OBJS))
 	@$(RANLIB) $@
--- a/config.mak.in	Fri Sep 28 02:08:17 2012 +0300
+++ b/config.mak.in	Fri Sep 28 02:20:31 2012 +0300
@@ -1,3 +1,8 @@
+# Build engine tests and tools? (Please notice that what
+# actually gets built it also affected by other options)
+DM_BUILD_TESTS=no
+DM_BUILD_TOOLS=yes
+
 # Build with runtime asserts?
 DM_USE_ASSERTS=yes