more properly handling new haa semantics
[drnoksnes] / Makefile
index bf5d5a3..108d616 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,29 @@
 #!/usr/bin/make
 
-CPPFLAGS := -I. $(shell sdl-config --cflags) $(shell pkg-config --cflags x11) -I/usr/include/hgw
-LDLIBS := -lz $(shell sdl-config --libs) $(shell pkg-config --libs x11) -lpopt -lhgw
+CPPFLAGS := -I. $(shell sdl-config --cflags) $(shell pkg-config --cflags x11)
+LDLIBS := -lz $(shell sdl-config --libs) $(shell pkg-config --libs x11) -lpopt
 
 -include config.mk
 
 # Sane defaults
+CONF_GUI?=1
 ifeq ($(ARCH),armel)
        CONF_BUILD_ASM_CPU?=1
        CONF_BUILD_ASM_SPC700?=1
        CONF_BUILD_ASM_SA1?=0   # Still not there
-       CONF_XSP?=1
        CONF_BUILD_MISC_ROUTINES?=misc_armel
 else ifeq ($(ARCH),i386)
        CONF_BUILD_ASM_CPU?=0
        CONF_BUILD_ASM_SPC700?=0
-       CONF_BUILD_ASM_SA1?=0   # Still not there
-       CONF_XSP?=0
+       CONF_BUILD_ASM_SA1?=0
        CONF_BUILD_MISC_ROUTINES?=misc_i386
 endif
+# Hardware pixel doubling (in N8x0)
+CONF_XSP?=0
+# Hildon Desktop compositing (in Fremantle)
+CONF_HD?=0
+# Link to libzeemote
+CONF_ZEEMOTE?=0
 
 # SNES stuff
 OBJS = apu.o c4.o c4emu.o cheats.o cheats2.o clip.o cpu.o cpuexec.o data.o
@@ -44,11 +49,6 @@ else
        OBJS += sa1cpu.o
 endif
 
-ifeq ($(CONF_XSP), 1)
-       CPPFLAGS += -DCONF_XSP=1 $(shell pkg-config --cflags xsp)
-       LDLIBS += $(shell pkg-config --libs xsp)
-endif
-
 OBJS += $(CONF_BUILD_MISC_ROUTINES).o
 
 # from open-whatever sdk
@@ -56,15 +56,41 @@ OBJS += unzip.o ioapi.o
 # my extensions to snes9x (speedhacks support)
 OBJS += hacks.o
 # the glue code that sticks it all together in a monstruous way
-OBJS += platform/path.o platform/config.o platform/hgw.o
+OBJS += platform/path.o platform/config.o
 OBJS += platform/sdl.o platform/sdlv.o platform/sdla.o platform/sdli.o
+OBJS += platform/sdlvscalers.o
+
+ifeq ($(CONF_XSP), 1)
+       CPPFLAGS += -DCONF_XSP=1 $(shell pkg-config --cflags xsp)
+       LDLIBS += $(shell pkg-config --libs xsp)
+endif
+ifeq ($(CONF_HD), 1)
+       CPPFLAGS += -DCONF_HD=1
+       LDLIBS += -lSDL_haa
+       CONF_EXIT_BUTTON ?= 1
+endif
+ifeq ($(CONF_GUI), 1)
+       CPPFLAGS += -DCONF_GUI=1 $(shell pkg-config --cflags libosso gconf-2.0)
+       LDLIBS += $(shell pkg-config --libs libosso gconf-2.0)
+       OBJS += platform/osso.o
+endif
+ifeq ($(CONF_EXIT_BUTTON), 1)
+       CPPFLAGS += -DCONF_EXIT_BUTTON=1
+       LDLIBS += -lSDL_image
+       OBJS += platform/sdlvexit.o
+endif
+ifeq ($(CONF_ZEEMOTE), 1)
+       CPPFLAGS += -DCONF_ZEEMOTE=1
+       LDLIBS += -lzeemote -lzeemote-conf -lbluetooth
+       OBJS += platform/zeemote.o
+endif
 
 # automatic dependencies
 DEPS := $(OBJS:.o=.d)
 
-all: drnoksnes gui
+all: drnoksnes
 
-clean: gui_clean
+clean:
        rm -f drnoksnes *.o *.d platform/*.o platform/*.d
        rm -f build-stamp configure-stamp
 
@@ -77,7 +103,6 @@ drnoksnes: $(OBJS)
 
 install: drnoksnes
        install drnoksnes $(DESTDIR)/usr/games
-       $(MAKE) -C gui install DESTDIR="$(DESTDIR)"
 
 deps: $(DEPS)
 %.d: %.cpp
@@ -87,11 +112,28 @@ deps: $(DEPS)
 %.d: %.s
        @touch $@
 
+# GUI
 gui:
        $(MAKE) -C gui all
 
 gui_clean:
        $(MAKE) -C gui clean
+       
+gui_install:
+       $(MAKE) -C gui install DESTDIR="$(DESTDIR)"
+       
+ifeq ($(CONF_GUI), 1)
+all: gui
+clean: gui_clean
+install: gui_install
+endif
+
+profclean: clean
+       find . -name '*.gcno' -delete
+       find . -name '*.gcda' -delete
+
+distclean: profclean clean
+       rm -f config.mk
 
-.PHONY: all clean remake deps install gui gui_clean
+.PHONY: all clean remake deps install gui gui_clean distclean