# HG changeset patch # User Matti Hamalainen # Date 1578963660 -7200 # Node ID 8abdd95139d6011482a6c39579191dd8472ce53f # Parent 9b4958ef4af20ce71d4ad3a4f38f04c3521ef128 Build system cleanups: reordering, more comments. diff -r 9b4958ef4af2 -r 8abdd95139d6 Makefile --- a/Makefile Tue Jan 14 02:44:11 2020 +0200 +++ b/Makefile Tue Jan 14 03:01:00 2020 +0200 @@ -1,6 +1,6 @@ -# -# Generic UNIX targets -# +### +### Generic UNIX targets +### DMLIB ?= ./ BINPATH ?= ./ OBJPATH ?= ./obj/unix/ diff -r 9b4958ef4af2 -r 8abdd95139d6 Makefile.cross-mingw --- a/Makefile.cross-mingw Tue Jan 14 02:44:11 2020 +0200 +++ b/Makefile.cross-mingw Tue Jan 14 03:01:00 2020 +0200 @@ -1,11 +1,12 @@ -# -# For Win32/Win64 version cross-compilation via MinGW -# compiler suite under Linux/Unix +### +### For Win32/Win64 version cross-compilation via MinGW +### compiler suite under Linux/Unix +### # # This Makefile assumes that you have MinGW installed under /usr # the way Debian MinGW packages do. It also assumes that you have # built/installed libogg, Tremor, libpng16, SDL2 ad SDL2_ttf under -# /usr/local in similar fashion. +# __ /usr/local __ (not /usr!) in similar fashion. # # For differing configurations you will have to either edit this # file or alternatively provide make parameters, e.g. @@ -49,7 +50,6 @@ #ZLIB_LDFLAGS ?= $(MINGW_LOCAL_PATH)/lib/libz.a ZLIB_LDFLAGS ?= $(MINGW_SYS_PATH)/lib/libz.a - TOOL_LDFLAGS ?= -mconsole -lmingw32 include $(DMLIB)Makefile.gen diff -r 9b4958ef4af2 -r 8abdd95139d6 Makefile.gen --- a/Makefile.gen Tue Jan 14 02:44:11 2020 +0200 +++ b/Makefile.gen Tue Jan 14 03:01:00 2020 +0200 @@ -27,7 +27,7 @@ ### -### Paths and directories +### Tools, paths and directories ### MKDIR ?= mkdir MKDIR_P ?= $(MKDIR) -p @@ -42,7 +42,6 @@ DMLIB_SRC = $(DMLIB)src/ - ### ### Extra debug messages etc? ### @@ -294,6 +293,29 @@ ### +### Main targets and objects +### +DMLIB_A = $(OBJPATH)dmlib.a +DMLIB_OBJS += \ + dmfile.o dmlib.o dmcurves.o dmstring.o \ + dmgrowbuf.o dmargs.o dmvecmat.o dmperlin.o \ + dmimage.o dmengine.o dmfft.o dmzlib.o \ + dmlicense.o + + +TESTS_TARGETS = $(addprefix $(TESTS_BINPATH),$(addsuffix $(BINEXT),$(TESTS_BINARIES))) +TOOL_TARGETS = $(addprefix $(TOOL_BINPATH),$(addsuffix $(BINEXT),$(TOOL_BINARIES))) + +TARGETS += \ + $(DMLIB_A) \ + $(addprefix $(BINPATH),$(addsuffix $(BINEXT),$(BINARIES))) \ + $(TOOL_TARGETS) $(TESTS_TARGETS) + +NOBUILD_TARGETS += +NOINST_TARGETS += + + +### ### Functions and compilation/link commands ### ifneq ($(V),1) @@ -327,34 +349,11 @@ ### -### Main targets and objects +### Generic target rules ### -DMLIB_A = $(OBJPATH)dmlib.a -DMLIB_OBJS += \ - dmfile.o dmlib.o dmcurves.o dmstring.o \ - dmgrowbuf.o dmargs.o dmvecmat.o dmperlin.o \ - dmimage.o dmengine.o dmfft.o dmzlib.o \ - dmlicense.o - - -TESTS_TARGETS = $(addprefix $(TESTS_BINPATH),$(addsuffix $(BINEXT),$(TESTS_BINARIES))) -TOOL_TARGETS = $(addprefix $(TOOL_BINPATH),$(addsuffix $(BINEXT),$(TOOL_BINARIES))) - -TARGETS += \ - $(DMLIB_A) \ - $(addprefix $(BINPATH),$(addsuffix $(BINEXT),$(BINARIES))) \ - $(TOOL_TARGETS) $(TESTS_TARGETS) - -NOBUILD_TARGETS += -NOINST_TARGETS += - - all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS) -### -### Generic object rules -### $(OBJPATH)%.o: $(DMLIB)tests/%.c $(DMLIB)tests/%.h $(COMPILE_C_OBJ)