2008-01-13 03:17:35 +00:00
|
|
|
MACHINE= $(shell uname -s)
|
2008-01-24 05:33:18 +00:00
|
|
|
SYSCONFDIR=/etc
|
2007-11-14 12:06:48 +00:00
|
|
|
CC=gcc
|
|
|
|
CPPC=g++
|
2008-01-24 05:33:18 +00:00
|
|
|
CFLAGS=-W -Wall -Wno-unused -O3 -DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_ZLIB_H -DFINAL_VERSION -DBKPT_SUPPORT -DSDL -DSYSCONFDIR=\"$(SYSCONFDIR)\" -DUSE_OPENGL -DC_CORE
|
2007-11-14 12:06:48 +00:00
|
|
|
CXXFLAGS=${CFLAGS}
|
|
|
|
ASM=nasm
|
2007-12-31 01:24:58 +00:00
|
|
|
ASMFLAGS=-w-orphan-labels -f elf -DELF -O1 -Isrc/hq/asm/
|
2007-11-29 01:45:22 +00:00
|
|
|
LFLAGS=-lz -lpng -lGL `sdl-config --libs`
|
2007-11-19 19:58:21 +00:00
|
|
|
STRIP=strip -s
|
2007-11-19 23:09:00 +00:00
|
|
|
DEL=rm -f
|
|
|
|
OE=.o
|
2008-01-17 04:51:34 +00:00
|
|
|
OUT=vbam
|
2008-01-30 10:47:10 +00:00
|
|
|
BASEVERSION=1.8.0
|
2007-11-19 23:09:00 +00:00
|
|
|
|
2008-01-13 03:17:35 +00:00
|
|
|
ifeq ($(MACHINE),Darwin)
|
|
|
|
LFLAGS=-lz -lpng -framework OpenGL `sdl-config --libs`
|
|
|
|
endif
|
|
|
|
|
2007-11-19 23:09:00 +00:00
|
|
|
ifeq ($(PLATFORM),win)
|
2007-12-31 01:24:58 +00:00
|
|
|
ASMFLAGS=-w-orphan-labels -f win32 -O1 -Isrc/hq/asm/
|
2007-11-27 13:13:25 +00:00
|
|
|
LFLAGS=-lz -lpng -lSDL -lwsock32 -lopengl32
|
2007-11-19 23:09:00 +00:00
|
|
|
DELETECOMMAND = del
|
|
|
|
OE=.obj
|
2008-01-17 04:51:34 +00:00
|
|
|
OUT=vbam.exe
|
2007-11-19 23:09:00 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),win-cross)
|
|
|
|
CC=i586-mingw32-gcc
|
|
|
|
CPPC=i586-mingw32-g++
|
2007-12-31 01:24:58 +00:00
|
|
|
ASMFLAGS=-w-orphan-labels -f win32 -O1 -Isrc/hq/asm/
|
2007-11-27 13:13:25 +00:00
|
|
|
LFLAGS=-lz -lpng -lSDL -lwsock32 -lopengl32
|
2007-11-19 23:09:00 +00:00
|
|
|
STRIP=i586-mingw32-strip -s
|
|
|
|
OE=.obj
|
2008-01-17 04:51:34 +00:00
|
|
|
OUT=vbam.exe
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef $(PREFIX)
|
|
|
|
PREFIX=/usr/local
|
2007-11-19 23:09:00 +00:00
|
|
|
endif
|
|
|
|
|
2008-01-30 10:47:10 +00:00
|
|
|
ifndef VERSION
|
2008-01-30 22:37:22 +00:00
|
|
|
-SVNVERSION=$(shell test -d .svn && svnversion -n .)
|
2008-01-30 10:47:10 +00:00
|
|
|
BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION))
|
|
|
|
ifeq ($(BADCHARS),)
|
|
|
|
ifneq ($(SVNVERSION),)
|
|
|
|
ifneq ($(SVNVERSION),exported)
|
|
|
|
VERSION=$(BASEVERSION)-r$(subst M,,$(SVNVERSION))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef VERSION
|
|
|
|
CXXFLAGS+=-DVERSION=\"$(VERSION)\"
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2007-11-14 12:06:48 +00:00
|
|
|
MAINDIR=src
|
|
|
|
SDLDIR=src/sdl
|
2008-02-27 23:43:18 +00:00
|
|
|
AGBDIR=src/agb
|
2008-02-27 13:33:37 +00:00
|
|
|
DMGDIR=src/dmg
|
|
|
|
GBAPUDIR=src/dmg/gb_apu
|
2007-12-15 23:29:10 +00:00
|
|
|
FEXDIR=../dependencies/File_Extractor-0.4.3
|
2007-12-31 01:24:58 +00:00
|
|
|
HQCDIR=src/hq/c
|
|
|
|
HQASMDIR=src/hq/asm
|
2007-12-15 23:29:10 +00:00
|
|
|
|
2007-11-20 13:04:31 +00:00
|
|
|
|
2007-12-31 01:24:58 +00:00
|
|
|
ASMOBJ=${HQASMDIR}/hq3x_16${OE} ${HQASMDIR}/hq3x_32${OE} ${HQASMDIR}/hq4x_16${OE} \
|
2008-01-30 22:37:22 +00:00
|
|
|
${HQASMDIR}/hq4x_32${OE} ${HQASMDIR}/hq3x32${OE}
|
2007-11-20 13:04:31 +00:00
|
|
|
|
2007-12-04 09:08:44 +00:00
|
|
|
GBAPUOBJ=${GBAPUDIR}/Blip_Buffer${OE} ${GBAPUDIR}/Effects_Buffer${OE} ${GBAPUDIR}/Gb_Apu${OE} \
|
|
|
|
${GBAPUDIR}/Gb_Apu_State${OE} ${GBAPUDIR}/Gb_Oscs${OE} ${GBAPUDIR}/Multi_Buffer${OE}
|
|
|
|
|
2007-12-31 01:24:58 +00:00
|
|
|
CALTERNOBJ=${HQCDIR}/hq_implementation${OE}
|
2007-11-15 00:22:35 +00:00
|
|
|
|
2008-02-27 23:51:24 +00:00
|
|
|
MAINOBJ=${MAINDIR}/2xSaI${OE} ${MAINDIR}/admame${OE} ${AGBDIR}/agbprint${OE} ${MAINDIR}/armdis${OE} \
|
2007-11-19 23:09:00 +00:00
|
|
|
${MAINDIR}/bilinear${OE} ${MAINDIR}/bios${OE} ${MAINDIR}/Cheats${OE} ${MAINDIR}/CheatSearch${OE} \
|
2008-02-27 23:51:24 +00:00
|
|
|
${MAINDIR}/EEprom${OE} ${MAINDIR}/elf${OE} ${MAINDIR}/Flash${OE} ${AGBDIR}/GBA${OE} \
|
|
|
|
${AGBDIR}/gbafilter${OE} ${AGBDIR}/GBAGfx${OE} ${MAINDIR}/Globals${OE} ${MAINDIR}/interframe${OE} \
|
|
|
|
${MAINDIR}/hq2x${OE} ${AGBDIR}/GBA-thumb${OE} ${AGBDIR}/GBA-arm${OE} ${MAINDIR}/Mode0${OE} \
|
2007-11-19 23:09:00 +00:00
|
|
|
${MAINDIR}/Mode1${OE} ${MAINDIR}/Mode2${OE} ${MAINDIR}/Mode3${OE} ${MAINDIR}/Mode4${OE} \
|
2008-01-20 21:15:52 +00:00
|
|
|
${MAINDIR}/Mode5${OE} ${MAINDIR}/pixel${OE} \
|
2008-01-07 09:09:28 +00:00
|
|
|
${MAINDIR}/remote${OE} ${MAINDIR}/RTC${OE} ${MAINDIR}/scanline${OE} \
|
2008-01-24 05:33:18 +00:00
|
|
|
${MAINDIR}/Sound${OE} ${MAINDIR}/Sram${OE} ${MAINDIR}/Util${OE} \
|
2008-01-07 09:09:28 +00:00
|
|
|
${MAINDIR}/expr${OE} ${MAINDIR}/exprNode${OE} ${MAINDIR}/expr-lex${OE} \
|
|
|
|
${MAINDIR}/memgzio${OE}
|
2007-11-14 12:06:48 +00:00
|
|
|
|
2007-11-19 23:09:00 +00:00
|
|
|
DMGOBJ=${DMGDIR}/GB${OE} ${DMGDIR}/gbCheats${OE} ${DMGDIR}/gbDis${OE} ${DMGDIR}/gbGfx${OE} \
|
|
|
|
${DMGDIR}/gbGlobals${OE} ${DMGDIR}/gbMemory${OE} ${DMGDIR}/gbPrinter${OE} ${DMGDIR}/gbSGB${OE} \
|
|
|
|
${DMGDIR}/gbSound${OE}
|
2007-11-14 12:06:48 +00:00
|
|
|
|
2008-01-24 05:33:18 +00:00
|
|
|
SDLOBJ=${SDLDIR}/debugger${OE} ${SDLDIR}/SDL${OE} ${SDLDIR}/dummy${OE} ${SDLDIR}/filters${OE} \
|
|
|
|
${SDLDIR}/text${OE}
|
2007-11-14 12:06:48 +00:00
|
|
|
|
2007-12-04 09:08:44 +00:00
|
|
|
OBJECTS=${MAINOBJ} ${DMGOBJ} ${SDLOBJ} ${GBAPUOBJ}
|
2007-11-14 12:06:48 +00:00
|
|
|
|
2007-11-20 16:03:49 +00:00
|
|
|
ifeq ($(USEASM),yes)
|
|
|
|
OBJECTS+=${ASMOBJ}
|
|
|
|
else
|
|
|
|
OBJECTS+=${CALTERNOBJ}
|
|
|
|
endif
|
|
|
|
|
2007-12-15 23:29:10 +00:00
|
|
|
ifeq ($(USEFEX),yes)
|
2008-01-13 06:05:37 +00:00
|
|
|
LFLAGS+=-L${FEXDIR} -lfex
|
2007-12-25 19:44:16 +00:00
|
|
|
else
|
|
|
|
OBJECTS+=${MAINDIR}/fex_mini${OE}
|
2007-12-15 23:29:10 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2007-11-20 16:03:49 +00:00
|
|
|
|
2007-11-19 21:04:57 +00:00
|
|
|
.SUFFIXES: .c .cpp .asm
|
2007-11-14 12:06:48 +00:00
|
|
|
|
2007-11-19 23:09:00 +00:00
|
|
|
%${OE}: %.c
|
2007-11-14 12:06:48 +00:00
|
|
|
${CC} ${CFLAGS} -o $@ -c $<
|
|
|
|
|
2007-11-19 23:09:00 +00:00
|
|
|
%${OE}: %.cpp
|
2007-11-14 12:06:48 +00:00
|
|
|
${CPPC} ${CXXFLAGS} -o $@ -c $<
|
|
|
|
|
2007-11-19 23:09:00 +00:00
|
|
|
%${OE}: %.asm
|
2007-11-14 12:06:48 +00:00
|
|
|
${ASM} ${ASMFLAGS} -o $@ $<
|
|
|
|
|
2007-11-19 23:09:00 +00:00
|
|
|
ALL: ${OUT}
|
2007-11-14 12:06:48 +00:00
|
|
|
|
2007-12-14 22:38:32 +00:00
|
|
|
${OUT}: ${OBJECTS}
|
|
|
|
$(CPPC) -o $@ ${OBJECTS} ${LFLAGS}
|
2007-11-19 19:58:21 +00:00
|
|
|
$(STRIP) $@
|
2007-11-14 12:06:48 +00:00
|
|
|
|
|
|
|
clean:
|
2008-01-17 04:51:34 +00:00
|
|
|
$(DEL) ${OUT} ${OBJECTS}
|
|
|
|
|
|
|
|
install: ${OUT}
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
2008-01-24 05:33:18 +00:00
|
|
|
install -d $(DESTDIR)$(SYSCONFDIR)
|
2008-01-17 04:51:34 +00:00
|
|
|
install ./${OUT} $(DESTDIR)$(PREFIX)/bin
|
2008-01-24 05:33:18 +00:00
|
|
|
install ./${SDLDIR}/VisualBoyAdvance.cfg-example $(DESTDIR)$(SYSCONFDIR)/VisualBoyAdvance.cfg
|