# HG changeset patch # User Matti Hamalainen # Date 1511307201 -7200 # Node ID a9516570cc26dc2ce09b36e4ac8e21013c543cb0 # Parent ed04fb6da07ceb0426c6cbc3eb836cced83e3a35 Improve build, so that we can build the tools and tests with minimal depencies (e.g. without libSDL linking when possible.) And this also on Win32 MinGW. diff -r ed04fb6da07c -r a9516570cc26 Makefile --- a/Makefile Wed Nov 22 01:04:41 2017 +0200 +++ b/Makefile Wed Nov 22 01:33:21 2017 +0200 @@ -26,7 +26,7 @@ ZLIB_LDFLAGS ?= $(shell pkg-config --libs zlib) -TOOL_LDFLAGS ?= $(SDL_LDFLAGS) +TOOL_LDFLAGS ?= include $(DMLIB)Makefile.gen diff -r ed04fb6da07c -r a9516570cc26 Makefile.cross-mingw --- a/Makefile.cross-mingw Wed Nov 22 01:04:41 2017 +0200 +++ b/Makefile.cross-mingw Wed Nov 22 01:33:21 2017 +0200 @@ -31,6 +31,6 @@ ZLIB_CFLAGS ?= ZLIB_LDFLAGS ?= $(MINGW_PATH)/lib/libz.a -TOOL_LDFLAGS ?= -lmingw32 -lSDLmain -lSDL -mconsole +TOOL_LDFLAGS ?= -mconsole -lmingw32 include $(DMLIB)Makefile.gen diff -r ed04fb6da07c -r a9516570cc26 Makefile.gen --- a/Makefile.gen Wed Nov 22 01:04:41 2017 +0200 +++ b/Makefile.gen Wed Nov 22 01:33:21 2017 +0200 @@ -476,7 +476,7 @@ ### $(TOOL_BINPATH)fontconv$(EXEEXT): $(OBJPATH)fontconv.o $(DMLIB_A) @echo " LINK $+" - @$(CC) -o $@ $(filter %.o %.a,$+) $(DM_LDFLAGS) $(TOOL_LDFLAGS) $(SDL_TTF_LDFLAGS) $(ZLIB_LDFLAGS) -lm + @$(CC) -o $@ $(filter %.o %.a,$+) $(DM_LDFLAGS) $(TOOL_LDFLAGS) $(SDL_LDFLAGS) $(SDL_TTF_LDFLAGS) $(ZLIB_LDFLAGS) -lm $(TOOL_BINPATH)data2inc$(EXEEXT): $(OBJPATH)data2inc.o $(DMLIB_A) @echo " LINK $+" diff -r ed04fb6da07c -r a9516570cc26 src/dmmutex.h --- a/src/dmmutex.h Wed Nov 22 01:04:41 2017 +0200 +++ b/src/dmmutex.h Wed Nov 22 01:33:21 2017 +0200 @@ -4,6 +4,8 @@ * Programmed and designed by Matti 'ccr' Hamalainen * (C) Copyright 2012 Tecnic Software productions (TNSP) */ +#ifndef DMMUTEX_H +#define DMMUTEX_H 1 Uint32 SDL_ThreadID() { @@ -31,3 +33,5 @@ { (void) p; } + +#endif diff -r ed04fb6da07c -r a9516570cc26 src/dmtool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dmtool.h Wed Nov 22 01:33:21 2017 +0200 @@ -0,0 +1,14 @@ +/* + * DMLib + * Get rid of the SDL_main for some commandline tools + * Programmed and designed by Matti 'ccr' Hamalainen + * (C) Copyright 2012 Tecnic Software productions (TNSP) + */ +#ifndef DMTOOL_H +#define DMTOOL_H 1 + +// Get rid of the SDL_main mess for some commandline tools +#define _SDL_main_h +#define SDL_main main + +#endif diff -r ed04fb6da07c -r a9516570cc26 tests/evaltest.c --- a/tests/evaltest.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tests/evaltest.c Wed Nov 22 01:33:21 2017 +0200 @@ -1,3 +1,4 @@ +#include "dmtool.h" #include "dmlib.h" #include "dmeval.h" #include "dmargs.h" diff -r ed04fb6da07c -r a9516570cc26 tests/fptest.c --- a/tests/fptest.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tests/fptest.c Wed Nov 22 01:33:21 2017 +0200 @@ -1,3 +1,4 @@ +#include "dmtool.h" #include "dmlib.h" #include diff -r ed04fb6da07c -r a9516570cc26 tests/vecmattest.c --- a/tests/vecmattest.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tests/vecmattest.c Wed Nov 22 01:33:21 2017 +0200 @@ -1,6 +1,6 @@ +#include "dmtool.h" #include "dmlib.h" #include "dmvecmat.h" -#include "dmmutex.h" void printTest(const char *test, int expected, int result) { diff -r ed04fb6da07c -r a9516570cc26 tools/data2inc.c --- a/tools/data2inc.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tools/data2inc.c Wed Nov 22 01:33:21 2017 +0200 @@ -5,6 +5,7 @@ * * Please read file 'COPYING' for information on license and distribution. */ +#include "dmtool.h" #include "dmlib.h" #include "dmargs.h" #include "dmmutex.h" diff -r ed04fb6da07c -r a9516570cc26 tools/dumpmod.c --- a/tools/dumpmod.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tools/dumpmod.c Wed Nov 22 01:33:21 2017 +0200 @@ -5,6 +5,7 @@ * * Please read file 'COPYING' for information on license and distribution. */ +#include "dmtool.h" #include "jss.h" #include "jssmod.h" #include "dmargs.h" diff -r ed04fb6da07c -r a9516570cc26 tools/gentab.c --- a/tools/gentab.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tools/gentab.c Wed Nov 22 01:33:21 2017 +0200 @@ -1,3 +1,4 @@ +#include "dmtool.h" #include "dmlib.h" #include "dmargs.h" #include "dmcurves.h" diff -r ed04fb6da07c -r a9516570cc26 tools/gfxconv.c --- a/tools/gfxconv.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tools/gfxconv.c Wed Nov 22 01:33:21 2017 +0200 @@ -5,6 +5,7 @@ * * Please read file 'COPYING' for information on license and distribution. */ +#include "dmtool.h" #include "dmlib.h" #include "dmargs.h" #include "dmfile.h" diff -r ed04fb6da07c -r a9516570cc26 tools/mod2wav.c --- a/tools/mod2wav.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tools/mod2wav.c Wed Nov 22 01:33:21 2017 +0200 @@ -5,6 +5,7 @@ * * Please read file 'COPYING' for information on license and distribution. */ +#include "dmtool.h" #include #include #include diff -r ed04fb6da07c -r a9516570cc26 tools/objlink.c --- a/tools/objlink.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tools/objlink.c Wed Nov 22 01:33:21 2017 +0200 @@ -5,10 +5,10 @@ * * Please read file 'COPYING' for information on license and distribution. */ +#include "dmtool.h" #include "dmlib.h" #include "dmargs.h" #include "dmfile.h" -#include "dmmutex.h" #define MAX_FILENAMES (128) #define MAX_MEMBLOCKS (128) diff -r ed04fb6da07c -r a9516570cc26 tools/packed.c --- a/tools/packed.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tools/packed.c Wed Nov 22 01:33:21 2017 +0200 @@ -3,12 +3,12 @@ * Programmed and designed by Matti 'ccr' Hamalainen * (C) Copyright 2011 Tecnic Software productions (TNSP) */ +#include "dmtool.h" #include "dmlib.h" #include "dmargs.h" #include "dmpack.h" #include "dmfile.h" #include "dmres.h" -#include "dmmutex.h" #include diff -r ed04fb6da07c -r a9516570cc26 tools/xm2jss.c --- a/tools/xm2jss.c Wed Nov 22 01:04:41 2017 +0200 +++ b/tools/xm2jss.c Wed Nov 22 01:33:21 2017 +0200 @@ -5,6 +5,7 @@ * * Please read file 'COPYING' for information on license and distribution. */ +#include "dmtool.h" #include #include "jss.h" #include "jssmod.h"