# HG changeset patch # User Matti Hamalainen # Date 1578482651 -7200 # Node ID e61aaa51415c8b01c60bd0cf26c5e2a5b477fb26 # Parent 89cb931841759d704e6936b905330353989db18a Reorganize Makefile.gen some for clarity. diff -r 89cb93184175 -r e61aaa51415c Makefile.gen --- a/Makefile.gen Wed Jan 08 13:08:53 2020 +0200 +++ b/Makefile.gen Wed Jan 08 13:24:11 2020 +0200 @@ -1,5 +1,5 @@ ### -### Get settings from config.mak +### Get settings from config.mak or other include ### ifneq ($(DM_CONFIG),) ifneq ($(DM_CONFIG),no) @@ -9,6 +9,26 @@ include config.mak endif + +### +### Compiler flags +### +ifeq ($(EXTRA_CFLAGS),) +EXTRA_CFLAGS=-O3 +# -march=corei7 +endif + +CFLAGS += -g -W -Wall -DHAVE_STRING_H $(EXTRA_CFLAGS) +#CFLAGS += -std=c11 -D_FILE_OFFSET_BITS=64 +CXXFLAGS = $(CFLAGS) + +DM_CFLAGS += -I$(DMLIB_SRC) $(SDL_CFLAGS) +DM_LDFLAGS += $(LDFLAGS) + + +### +### Paths and directories +### MKDIR ?= mkdir MKDIR_P ?= $(MKDIR) -p BINPATH ?= ./ @@ -21,12 +41,6 @@ DMLIB_SRC = $(DMLIB)src/ -DM_CFLAGS += -I$(DMLIB_SRC) - -ifeq ($(EXTRA_CFLAGS),) -EXTRA_CFLAGS=-O3 -# -march=corei7 -endif ### @@ -280,16 +294,8 @@ ### -### Rest of the rules +### Compilation commands ### -CFLAGS += -g -W -Wall -DHAVE_STRING_H $(EXTRA_CFLAGS) -#CFLAGS += -std=c11 -D_FILE_OFFSET_BITS=64 -CXXFLAGS=$(CFLAGS) - -DM_CFLAGS += $(SDL_CFLAGS) -DM_LDFLAGS += $(LDFLAGS) - - ifneq ($(V),1) COMPILE_C_OBJ = @if test ! -d $(OBJPATH); then $(MKDIR_P) $(OBJPATH); fi && echo " CC $<" && $(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) COMPILE_CXX_OBJ = @if test ! -d $(OBJPATH); then $(MKDIR_P) $(OBJPATH); fi && echo " CXX $<" && $(CXX) $(CXXFLAGS) -c -o $@ $< $(DM_CFLAGS) @@ -305,6 +311,9 @@ endif +### +### Main targets and objects +### DMLIB_A = $(OBJPATH)dmlib.a DMLIB_OBJS += \ dmfile.o dmlib.o dmcurves.o dmstring.o \