diff options
author | Twinaphex | 2014-12-09 13:28:17 +0100 |
---|---|---|
committer | Twinaphex | 2014-12-09 13:28:17 +0100 |
commit | 988c2e2655c7c1f724ba727f008d84e3faa6cd24 (patch) | |
tree | da7bf131f33b9ae16d2a93a0a7615a3c0b9c7535 /x86/Makefile | |
parent | 7bb77f4fc090cadc23c3e05998ccebac7156e3cf (diff) | |
parent | e2d6ea9082a5ff977f834eda0bbb2362397422df (diff) | |
download | picogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.tar.gz picogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.tar.bz2 picogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.zip |
Merge pull request #2 from aliaspider/master
initial port of gpsp to libretro.
Diffstat (limited to 'x86/Makefile')
-rw-r--r-- | x86/Makefile | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/x86/Makefile b/x86/Makefile index 276996d..53d2dd8 100644 --- a/x86/Makefile +++ b/x86/Makefile @@ -8,35 +8,53 @@ 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 -BIN ?= gpsp.exe +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 -VPATH += .. +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) + CFLAGS += -DPC_BUILD -Wall -m32 -INCLUDES = -I${PREFIX}/include `sdl-config --cflags` -LIBS = -L${PREFIX}/lib `sdl-config --libs` -lz -m32 +INCLUDES = -I$(PREFIX)/include `sdl-config --cflags` +LIBS = -L$(PREFIX)/lib32 `sdl-config --libs` -lz -m32 # Compilation: -.SUFFIXES: .c .S +ifeq ($(DEBUG), 1) +OPTIMIZE := -O0 -g +OPTIMIZE_SAFE := -O0 -g +else +OPTIMIZE := -O3 +OPTIMIZE_SAFE := -O2 +endif -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) |