bsnes/higan/target-bsnes/GNUmakefile

80 lines
2.2 KiB
Makefile

name := bsnes
flags += -DSFC_SUPERGAMEBOY
include sfc/GNUmakefile
include gb/GNUmakefile
include processor/GNUmakefile
ui_objects := ui-bsnes ui-program ui-input ui-presentation ui-settings
ui_objects += ruby hiro
ui_objects += $(if $(call streq,$(platform),windows),ui-resource)
# platform
ifeq ($(platform),windows)
else ifeq ($(platform),macos)
else ifeq ($(platform),linux)
else ifeq ($(platform),bsd)
ruby += video.glx video.xvideo video.xshm video.sdl
ruby += audio.oss audio.openal
ruby += input.sdl input.xlib
endif
# ruby
include ../ruby/GNUmakefile
link += $(rubylink)
# hiro
include ../hiro/GNUmakefile
link += $(hirolink)
# rules
objects := $(ui_objects) $(objects)
objects := $(patsubst %,obj/%.o,$(objects))
obj/ruby.o: ../ruby/ruby.cpp $(call rwildcard,../ruby/)
$(compiler) $(rubyflags) -c $< -o $@
obj/hiro.o: ../hiro/hiro.cpp $(call rwildcard,../hiro/)
$(compiler) $(hiroflags) -c $< -o $@
obj/ui-bsnes.o: $(ui)/bsnes.cpp $(call rwildcard,$(ui)/)
obj/ui-program.o: $(ui)/program/program.cpp $(call rwildcard,$(ui)/)
obj/ui-input.o: $(ui)/input/input.cpp $(call rwildcard,$(ui)/)
obj/ui-presentation.o: $(ui)/presentation/presentation.cpp $(call rwildcard,$(ui)/)
obj/ui-settings.o: $(ui)/settings/settings.cpp $(call rwildcard,$(ui)/)
obj/ui-resource.o:
$(windres) data/bsnes.rc obj/ui-resource.o
# targets
build: $(objects)
$(strip $(compiler) -o out/$(name) $(objects) $(link))
ifeq ($(platform),macos)
endif
install:
ifeq ($(shell id -un),root)
$(error "make install should not be run as root")
else ifeq ($(platform),windows)
else ifeq ($(platform),macos)
else ifneq ($(filter $(platform),linux bsd),)
mkdir -p $(prefix)/bin/
mkdir -p $(prefix)/share/applications/
mkdir -p $(prefix)/share/icons/
mkdir -p $(prefix)/share/$(name)/
cp out/$(name) $(prefix)/bin/$(name)
cp data/$(name).desktop $(prefix)/share/applications/$(name).desktop
cp data/$(name).png $(prefix)/share/icons/$(name).png
endif
uninstall:
ifeq ($(shell id -un),root)
$(error "make uninstall should not be run as root")
else ifeq ($(platform),windows)
else ifeq ($(platform),macos)
else ifneq ($(filter $(platform),linux bsd),)
rm -f $(prefix)/bin/$(name)
rm -f $(prefix)/share/applications/$(name).desktop
rm -f $(prefix)/share/icons/$(name).png
endif