From 35e1e44a1107c73a3aaccb0eff44757c602afdac Mon Sep 17 00:00:00 2001 From: aliaspider Date: Mon, 8 Dec 2014 22:55:41 +0100 Subject: fix binary name for the x86 target on non windows platforms. --- x86/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'x86') diff --git a/x86/Makefile b/x86/Makefile index 276996d..319a4a7 100644 --- a/x86/Makefile +++ b/x86/Makefile @@ -10,17 +10,27 @@ AS = as PREFIX = /usr OBJS = main.o cpu.o memory.o video.o input.o sound.o \ cpu_threaded.o gui.o x86_stub.o cheats.o zip.o -BIN ?= gpsp.exe # Platform specific definitions +ifeq ($(shell uname -a),) +EXE_EXT = .exe +else ifneq ($(findstring MINGW,$(shell uname -a)),) +EXE_EXT = .exe +else +EXE_EXT = +endif + +BIN ?= gpsp$(EXE_EXT) + VPATH += .. CFLAGS += -DPC_BUILD -Wall -m32 INCLUDES = -I${PREFIX}/include `sdl-config --cflags` -LIBS = -L${PREFIX}/lib `sdl-config --libs` -lz -m32 +LIBS = -L${PREFIX}/lib32 `sdl-config --libs` -lz -m32 # Compilation: + .SUFFIXES: .c .S all: ${BIN} -- cgit v1.2.3 From 3cc3944725700c957b006de6f5a2ee2944d2f525 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Tue, 9 Dec 2014 02:43:59 +0100 Subject: add debug build option to x86 standalone target. --- x86/Makefile | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'x86') diff --git a/x86/Makefile b/x86/Makefile index 319a4a7..53d2dd8 100644 --- a/x86/Makefile +++ b/x86/Makefile @@ -8,8 +8,8 @@ STRIP = strip AS = as PREFIX = /usr -OBJS = main.o cpu.o memory.o video.o input.o sound.o \ - cpu_threaded.o gui.o x86_stub.o cheats.o zip.o +OBJS = ../main.o ../cpu.o ../memory.o ../video.o ../input.o ../sound.o \ + ../cpu_threaded.o ../gui.o x86_stub.o ../cheats.o ../zip.o # Platform specific definitions @@ -23,30 +23,38 @@ endif BIN ?= gpsp$(EXE_EXT) -VPATH += .. CFLAGS += -DPC_BUILD -Wall -m32 -INCLUDES = -I${PREFIX}/include `sdl-config --cflags` -LIBS = -L${PREFIX}/lib32 `sdl-config --libs` -lz -m32 +INCLUDES = -I$(PREFIX)/include `sdl-config --cflags` +LIBS = -L$(PREFIX)/lib32 `sdl-config --libs` -lz -m32 # Compilation: +ifeq ($(DEBUG), 1) +OPTIMIZE := -O0 -g +OPTIMIZE_SAFE := -O0 -g +else +OPTIMIZE := -O3 +OPTIMIZE_SAFE := -O2 +endif -.SUFFIXES: .c .S - -all: ${BIN} +all: $(BIN) %.o: %.c - ${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $< + $(CC) $(CFLAGS) $(OPTIMIZE) $(INCLUDES) -c -o $@ $< %.o: %.S - ${CC} ${CFLAGS} -c -o $@ $< + $(CC) $(CFLAGS) $(OPTIMIZE) -c -o $@ $< + +../cpu.o: ../cpu.c + $(CC) -c -o $@ $< $(CFLAGS) -Wno-unused-variable -Wno-unused-label $(OPTIMIZE_SAFE) $(INCLUDES) + +../cpu_threaded.o: ../cpu_threaded.c + $(CC) -c -o $@ $< $(CFLAGS) -Wno-unused-variable -Wno-unused-label $(OPTIMIZE_SAFE) $(INCLUDES) -cpu.o cpu_threaded.o: CFLAGS += -Wno-unused-variable -Wno-unused-label -${BIN}: ${OBJS} - ${CC} ${OBJS} ${LIBS} -o ${BIN} -# ${STRIP} ${BIN} +$(BIN): $(OBJS) + $(CC) $(OBJS) $(LIBS) -o $(BIN) clean: - rm -f *.o ${BIN} + rm -f $(OBJS) $(BIN) -- cgit v1.2.3