AR = ar
RANLIB = ranlib
ETAGS = etags
+STRIP = strip
RM = rm -f
CONVERT = convert
# $(info Using SDL version $(SDL_VERSION) [TARGET == $(TARGET)])
ifeq ($(TARGET),sdl2) # compiling for SDL2 target
-SYS_CFLAGS = -DTARGET_SDL2 $(shell sdl2-config --cflags)
SDL_LIBS = -lSDL2_image -lSDL2_mixer -lSDL2_net
-SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl2-config --libs)
+SYS_CFLAGS := -DTARGET_SDL2 $(shell sdl2-config --cflags)
+SYS_LDFLAGS := $(SDL_LIBS) $(shell sdl2-config --libs) -lm -lz
endif
# PROFILING = $(PROFILING_FLAGS)
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
-# OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes
+# OPTIONS = $(DEBUG) -O2 -Wall # only for debugging purposes
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes
# OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes
-# OPTIONS = -O3 -Wall -ansi -pedantic
-# OPTIONS = -O3 -Wall
-# OPTIONS = -O3
+# OPTIONS = -O2 -Wall -ansi -pedantic
+# OPTIONS = -O2 -Wall
+# OPTIONS = -O2
ifdef BUILD_DIST # distribution build
SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) | \
sed -e "s%-rpath,[^ ]*%-rpath,'\$$ORIGIN/lib'%")
-OPTIONS = -O3 -Wall
+OPTIONS = -O2 -Wall
endif
CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(EXTRA_CFLAGS) $(CONFIG)
-LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm -lz
+LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS)
SRCS = main.c \
$(PROGNAME): $(RNDLIBS) $(TIMESTAMP_FILE) $(COMMIT_HASH_FILE) $(OBJS) $(ICON)
$(CC) $(PROFILING) $(OBJS) $(ICON) $(RNDLIBS) $(LDFLAGS) -o $(PROGNAME)
ifdef BUILD_DIST
- strip $(PROGNAME)
+ $(STRIP) $(PROGNAME)
endif
libgame_dir: