bsnes/snesreader/Makefile

189 lines
5.5 KiB
Makefile
Raw Normal View History

include nall/Makefile
qtlibs := QtCore QtGui
include nall/qt/Makefile
Update to bsnes v061 release. Please keep in mind that bsnes v060 remains the current stable release. v061 has been released as a work-in-progress build. As such, it is only available at Google Code. I am releasing this WIP to allow the public to test out and comment on the new XML mapping system, as well as the integration of mightymo's cheat code database into the cheat editor. I would greatly appreciate feedback on these two on the forums. There are some important issues with this release. The biggest is the move to C++0x. This requires GCC 4.4.0 or newer to compile, thus it is not currently possible to build this on OS X using Xcode. Nor would it be possible on certain BSDs or older distros. If you have an older compiler, please stick with v060, or use a binary release where available. Another issue is that TDM/GCC 4.4.1 for Windows crashes with an internal compiler error when attempting to generate a profile for the DSP-1 module. This is a bug in the compiler, and not in the code itself. The workaround is to simply omit profile-guided optimization for this one object. Lastly, there's also a known bug in the memory mapping. If you load an SA-1 game, SuperFX games will not load properly afterward unless you restart the emulator. I'm looking into the cause now, but it didn't seem serious enough to hold up a WIP release. So, yes. If you want a good gaming experience that's been fully tested and stable, please stick with v060. If you want to see some bleeding edge features, I'd appreciate feedback on v061. Thanks for reading this. Changelog: - added mightymo's cheat code database, access via "Find Cheat Codes" button on cheat editor window - added an option to temporarily disable all cheat codes quickly - debugger now properly uses S-SMP IPLROM when needed for disassembling and tracing - indexed indirect read opcodes in the S-CPU were testing for IRQs one cycle too early [someone42] - fix an off-by-one array iteration in S-PPU OAM rendering [PiCiJi] - added some implicit linked libraries to linker flags for Fedora [belegdol] - moved from C++98 to C++0x, resulting in substantial code cleanups and simplifications - C++0x: implemented foreach() concept for linear container iteration - C++0x: implemented concept system using SFINAE and type traits - C++0x: utilized auto keyword to increase source readability - C++0x: moved to strongly-typed enumerators - C++0x: rewrote va_list-based code to use type-safe variadic templates - C++0x: replaced noncopyable class with deleted default copy functions - C++0x: replaced custom static_assert template class with built-in version - C++0x: utilized rvalue references to implement move semantics into string, array, vector and serialization classes - C++0x: utilized std::initializer_list for { ... } initialization support to lstring, array and vector classes
2010-03-07 02:17:46 +00:00
c := $(compiler) -std=gnu99
cpp := $(subst cc,++,$(compiler)) -std=gnu++0x
flags := -O3 -I. -Iobj -fomit-frame-pointer
link :=
ifeq ($(platform),x)
flags := -fPIC $(flags)
link += -s
else ifeq ($(platform),osx)
flags := -fPIC $(flags)
endif
objects := snesreader
# fex
objects += Binary_Extractor blargg_common blargg_errors Data_Reader fex File_Extractor Gzip_Extractor Gzip_Reader Rar_Extractor Zip7_Extractor Zip_Extractor Zlib_Inflater
# zlib
objects += adler32 crc32 inffast inflate inftrees zutil
# 7-zip
objects += 7zAlloc 7zBuf 7zCrc 7zDecode 7zExtract 7zHeader 7zIn 7zItem 7zStream Bcj2 Bra86 LzmaDec
# unrar
objects += archive arcread coder crc encname extract getbits model rarvm rarvmtbl rawread suballoc unicode unpack unpack15 unpack20 unrar unrar_misc unrar_open
# micro-bunzip
objects += micro-bunzip
# jma
objects += jma jcrc32 lzmadecode 7zlzma iiostrm inbyte lzma winout
compile = \
$(strip \
$(if $(filter %.c,$<), \
$(c) $(flags) $1 -c $< -o $@, \
$(if $(filter %.cpp,$<), \
$(cpp) $(flags) $1 -c $< -o $@ \
) \
) \
)
%.o: $<; $(call compile)
all: build;
objects := $(patsubst %,obj/%.o,$(objects))
moc_headers := $(call rwildcard,./,%.moc.hpp)
moc_objects := $(foreach f,$(moc_headers),obj/$(notdir $(patsubst %.moc.hpp,%.moc,$f)))
# automatically run moc on all .moc.hpp (MOC header) files
%.moc: $<; $(moc) -i $< -o $@
# automatically generate %.moc build rules
__list = $(moc_headers)
$(foreach f,$(moc_objects), \
$(eval __file = $(word 1,$(__list))) \
$(eval __list = $(wordlist 2,$(words $(__list)),$(__list))) \
$(eval $f: $(__file)) \
)
##################
### snesreader ###
##################
obj/snesreader.o: snesreader.cpp *
$(call compile,$(qtinc))
###########
### fex ###
###########
obj/Binary_Extractor.o: fex/Binary_Extractor.cpp fex/*
obj/blargg_common.o : fex/blargg_common.cpp fex/*
obj/blargg_errors.o : fex/blargg_errors.cpp fex/*
obj/Data_Reader.o : fex/Data_Reader.cpp fex/*
obj/fex.o : fex/fex.cpp fex/*
obj/File_Extractor.o : fex/File_Extractor.cpp fex/*
obj/Gzip_Extractor.o : fex/Gzip_Extractor.cpp fex/*
obj/Gzip_Reader.o : fex/Gzip_Reader.cpp fex/*
obj/Rar_Extractor.o : fex/Rar_Extractor.cpp fex/*
obj/Zip7_Extractor.o : fex/Zip7_Extractor.cpp fex/*
obj/Zip_Extractor.o : fex/Zip_Extractor.cpp fex/*
obj/Zlib_Inflater.o : fex/Zlib_Inflater.cpp fex/*
############
### zlib ###
############
obj/adler32.o : zlib/adler32.c zlib/*
obj/crc32.o : zlib/crc32.c zlib/*
obj/inffast.o : zlib/inffast.c zlib/*
obj/inflate.o : zlib/inflate.c zlib/*
obj/inftrees.o: zlib/inftrees.c zlib/*
obj/zutil.o : zlib/zutil.c zlib/*
#############
### 7-zip ###
#############
obj/7zAlloc.o : 7z_C/7zAlloc.c 7z_C/*
obj/7zBuf.o : 7z_C/7zBuf.c 7z_C/*
obj/7zCrc.o : 7z_C/7zCrc.c 7z_C/*
obj/7zDecode.o : 7z_C/7zDecode.c 7z_C/*
obj/7zExtract.o: 7z_C/7zExtract.c 7z_C/*
obj/7zHeader.o : 7z_C/7zHeader.c 7z_C/*
obj/7zIn.o : 7z_C/7zIn.c 7z_C/*
obj/7zItem.o : 7z_C/7zItem.c 7z_C/*
obj/7zStream.o : 7z_C/7zStream.c 7z_C/*
obj/Bcj2.o : 7z_C/Bcj2.c 7z_C/*
obj/Bra86.o : 7z_C/Bra86.c 7z_C/*
obj/LzmaDec.o : 7z_C/LzmaDec.c 7z_C/*
####################
### micro-bunzip ###
####################
obj/micro-bunzip.o: micro-bunzip/micro-bunzip.c micro-bunzip/*
#############
### unrar ###
#############
obj/archive.o : unrar/archive.cpp unrar/*
obj/arcread.o : unrar/arcread.cpp unrar/*
obj/coder.o : unrar/coder.cpp unrar/*
obj/crc.o : unrar/crc.cpp unrar/*
obj/encname.o : unrar/encname.cpp unrar/*
obj/extract.o : unrar/extract.cpp unrar/*
obj/getbits.o : unrar/getbits.cpp unrar/*
obj/model.o : unrar/model.cpp unrar/*
obj/rarvm.o : unrar/rarvm.cpp unrar/*
obj/rarvmtbl.o : unrar/rarvmtbl.cpp unrar/*
obj/rawread.o : unrar/rawread.cpp unrar/*
obj/suballoc.o : unrar/suballoc.cpp unrar/*
obj/unicode.o : unrar/unicode.cpp unrar/*
obj/unpack.o : unrar/unpack.cpp unrar/*
obj/unpack15.o : unrar/unpack15.cpp unrar/*
obj/unpack20.o : unrar/unpack20.cpp unrar/*
obj/unrar.o : unrar/unrar.cpp unrar/*
obj/unrar_misc.o: unrar/unrar_misc.cpp unrar/*
obj/unrar_open.o: unrar/unrar_open.cpp unrar/*
##############
### libjma ###
##############
obj/jma.o : libjma/jma.cpp libjma/*
obj/jcrc32.o : libjma/jcrc32.cpp libjma/*
obj/lzmadecode.o: libjma/lzmadecode.cpp libjma/*
obj/7zlzma.o : libjma/7zlzma.cpp libjma/*
obj/iiostrm.o : libjma/iiostrm.cpp libjma/*
obj/inbyte.o : libjma/inbyte.cpp libjma/*
obj/lzma.o : libjma/lzma.cpp libjma/*
obj/winout.o : libjma/winout.cpp libjma/*
###############
### targets ###
###############
build: $(moc_objects) $(objects)
ifeq ($(platform),x)
ar rcs libsnesreader.a $(objects)
$(cpp) $(link) -o libsnesreader.so -shared -Wl,-soname,libsnesreader.so.1 $(objects) $(qtlib)
else ifeq ($(platform),osx)
ar rcs libsnesreader.a $(objects)
$(cpp) $(link) -o libsnesreader.dylib -shared -dynamiclib $(objects) $(qtlib)
else ifeq ($(platform),win)
$(cpp) $(link) -o snesreader.dll -shared -Wl,--out-implib,libsnesreader.a $(objects) $(qtlib)
endif
install:
ifeq ($(platform),x)
install -D -m 755 libsnesreader.a $(DESTDIR)$(prefix)/lib
install -D -m 755 libsnesreader.so $(DESTDIR)$(prefix)/lib
ldconfig -n $(DESTDIR)$(prefix)/lib
else ifeq ($(platform),osx)
cp libsnesreader.dylib /usr/local/lib/libsnesreader.dylib
endif
clean:
-@$(call delete,obj/*.o)
-@$(call delete,obj/*.moc)
-@$(call delete,libsnesreader.a)
-@$(call delete,libsnesreader.so)
-@$(call delete,libsnesreader.dylib)
-@$(call delete,snesreader.dll)