From e6d53f33a91883338e1d08041ae12a6d0462f23e Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 24 Jan 2015 19:40:35 -0800 Subject: [PATCH] * Modularize build system --- Athena.pri | 126 ++--------------------------------------- Athena.pro | 141 +--------------------------------------------- AthenaCore.pri | 51 +++++++++++++++++ AthenaSakura.pri | 19 +++++++ AthenaWiiSave.pri | 54 ++++++++++++++++++ AthenaZelda.pri | 44 +++++++++++++++ 6 files changed, 175 insertions(+), 260 deletions(-) create mode 100644 AthenaCore.pri create mode 100644 AthenaSakura.pri create mode 100644 AthenaWiiSave.pri create mode 100644 AthenaZelda.pri diff --git a/Athena.pri b/Athena.pri index b26f73a..2d41bb0 100644 --- a/Athena.pri +++ b/Athena.pri @@ -1,122 +1,4 @@ -INCLUDEPATH += $$PWD/include - -unix:LIBS += -lz -win32:LIBS += -lzlib -QMAKE_CXXFLAGS += -std=c++11 - -SOURCES += \ - $$PWD/src/Athena/Utility.cpp \ - $$PWD/src/Athena/FileReader.cpp \ - $$PWD/src/Athena/FileWriter.cpp \ - $$PWD/src/Athena/BinaryReader.cpp \ - $$PWD/src/Athena/BinaryWriter.cpp \ - $$PWD/src/Athena/Global.cpp \ - $$PWD/src/Athena/ALTTPFile.cpp \ - $$PWD/src/Athena/ALTTPFileReader.cpp \ - $$PWD/src/Athena/ALTTPFileWriter.cpp \ - $$PWD/src/Athena/ALTTPQuest.cpp \ - $$PWD/src/Athena/Checksums.cpp \ - $$PWD/src/Athena/Compression.cpp \ - $$PWD/src/Athena/MCFile.cpp \ - $$PWD/src/Athena/MCFileReader.cpp \ - $$PWD/src/Athena/MCFileWriter.cpp \ - $$PWD/src/Athena/SkywardSwordFile.cpp \ - $$PWD/src/Athena/SkywardSwordFileReader.cpp \ - $$PWD/src/Athena/SkywardSwordFileWriter.cpp \ - $$PWD/src/Athena/SkywardSwordQuest.cpp \ - $$PWD/src/Athena/Sprite.cpp \ - $$PWD/src/Athena/SpriteFile.cpp \ - $$PWD/src/Athena/SpriteFileReader.cpp \ - $$PWD/src/Athena/SpriteFileWriter.cpp \ - $$PWD/src/Athena/SpriteFrame.cpp \ - $$PWD/src/Athena/SpritePart.cpp \ - $$PWD/src/Athena/WiiBanner.cpp \ - $$PWD/src/Athena/WiiFile.cpp \ - $$PWD/src/Athena/WiiImage.cpp \ - $$PWD/src/Athena/WiiSave.cpp \ - $$PWD/src/Athena/WiiSaveReader.cpp \ - $$PWD/src/Athena/WiiSaveWriter.cpp \ - $$PWD/src/Athena/ZQuestFile.cpp \ - $$PWD/src/Athena/ZQuestFileReader.cpp \ - $$PWD/src/Athena/ZQuestFileWriter.cpp \ - $$PWD/src/bn.cpp \ - $$PWD/src/ec.cpp \ - $$PWD/src/md5.cpp \ - $$PWD/src/sha1.cpp \ - $$PWD/src/aes.c \ - $$PWD/src/lzo.c \ - $$PWD/src/Athena/PHYSFSFileReader.cpp \ - $$PWD/src/LZ77/LZLookupTable.cpp \ - $$PWD/src/LZ77/LZType10.cpp \ - $$PWD/src/LZ77/LZType11.cpp \ - $$PWD/src/LZ77/LZBase.cpp \ - $$PWD/src/Athena/MCSlot.cpp -win32:SOURCES += $$PWD/src/win32_largefilewrapper.c - -HEADERS += \ - $$PWD/include/Athena/Stream.hpp \ - $$PWD/include/Athena/Types.hpp \ - $$PWD/include/Athena/Utility.hpp \ - $$PWD/include/Athena/Global.hpp \ - $$PWD/include/Athena/Exception.hpp \ - $$PWD/include/Athena/FileNotFoundException.hpp \ - $$PWD/include/Athena/IOException.hpp \ - $$PWD/include/Athena/InvalidDataException.hpp \ - $$PWD/include/Athena/InvalidOperationException.hpp \ - $$PWD/include/Athena/FileReader.hpp \ - $$PWD/include/Athena/FileWriter.hpp \ - $$PWD/include/utf8.h \ - $$PWD/include/utf8/checked.h \ - $$PWD/include/utf8/core.h \ - $$PWD/include/utf8/unchecked.h \ - $$PWD/include/Athena/BinaryReader.hpp \ - $$PWD/include/Athena/BinaryWriter.hpp \ - $$PWD/include/Athena/NotImplementedException.hpp \ - $$PWD/include/aes.h \ - $$PWD/include/bn.h \ - $$PWD/include/ec.h \ - $$PWD/include/lzo.h \ - $$PWD/include/md5.h \ - $$PWD/include/sha1.h \ - $$PWD/include/Athena/ALTTPEnums.hpp \ - $$PWD/include/Athena/ALTTPFile.hpp \ - $$PWD/include/Athena/ALTTPFileReader.hpp \ - $$PWD/include/Athena/ALTTPFileWriter.hpp \ - $$PWD/include/Athena/ALTTPQuest.hpp \ - $$PWD/include/Athena/ALTTPStructs.hpp \ - $$PWD/include/Athena/Checksums.hpp \ - $$PWD/include/Athena/Compression.hpp \ - $$PWD/include/Athena/MCFile.hpp \ - $$PWD/include/Athena/MCFileReader.hpp \ - $$PWD/include/Athena/MCFileWriter.hpp \ - $$PWD/include/Athena/SkywardSwordFile.hpp \ - $$PWD/include/Athena/SkywardSwordFileReader.hpp \ - $$PWD/include/Athena/SkywardSwordFileWriter.hpp \ - $$PWD/include/Athena/SkywardSwordQuest.hpp \ - $$PWD/include/Athena/Sprite.hpp \ - $$PWD/include/Athena/SpriteFile.hpp \ - $$PWD/include/Athena/SpriteFileReader.hpp \ - $$PWD/include/Athena/SpriteFileWriter.hpp \ - $$PWD/include/Athena/SpriteFrame.hpp \ - $$PWD/include/Athena/SpritePart.hpp \ - $$PWD/include/Athena/WiiBanner.hpp \ - $$PWD/include/Athena/WiiFile.hpp \ - $$PWD/include/Athena/WiiImage.hpp \ - $$PWD/include/Athena/WiiSave.hpp \ - $$PWD/include/Athena/WiiSaveReader.hpp \ - $$PWD/include/Athena/WiiSaveWriter.hpp \ - $$PWD/include/Athena/ZQuestFile.hpp \ - $$PWD/include/Athena/ZQuestFileReader.hpp \ - $$PWD/include/Athena/ZQuestFileWriter.hpp \ - $$PWD/include/Athena/PHYSFSFileReader.hpp \ - $$PWD/include/LZ77/LZBase.hpp \ - $$PWD/include/LZ77/LZLookupTable.hpp \ - $$PWD/include/LZ77/LZType10.hpp \ - $$PWD/include/LZ77/LZType11.hpp \ - $$PWD/src/Athena/MCSlot.hpp - -win32:HEADERS += \ - $$PWD/include/win32_largefilewrapper.h - -OTHER_FILES += \ - .travis.yml +include(AthenaCore.pri) +include(AthenaZelda.pri) +include(AthenaWiiSave.pri) +include(AthenaSakura.pri) \ No newline at end of file diff --git a/Athena.pro b/Athena.pro index 29a718c..29d566b 100644 --- a/Athena.pro +++ b/Athena.pro @@ -1,7 +1,6 @@ CONFIG += staticlib c++11 TEMPLATE= lib DESTDIR = ./lib -unix:QMAKE_CXXFLAGS += -std=c++11 # Uncomment this if you wish to use Qt with libAthena #DEFINES += ATHENA_USE_QT @@ -12,7 +11,7 @@ contains(DEFINES, ATHENA_USE_QT){ QT = } -CONFIG(debug, debug|release){ +CONFIG(debug, debug|release): { DEFINES += DEBUG TARGET=Athena-d # We don't want the objects, @@ -21,7 +20,7 @@ CONFIG(debug, debug|release){ OBJECTS_DIR = obj/debug } -CONFIG(release, release|debug){ +CONFIG(release, release|debug): { DEFINES -= DEBUG TARGET=Athena # We don't want the objects, @@ -30,143 +29,9 @@ CONFIG(release, release|debug){ OBJECTS_DIR = obj/release } -INCLUDEPATH += include +include(Athena.pri) -SOURCES += \ - src/Athena/Utility.cpp \ - src/Athena/FileReader.cpp \ - src/Athena/FileWriter.cpp \ - src/Athena/BinaryReader.cpp \ - src/Athena/BinaryWriter.cpp \ - src/Athena/Global.cpp \ - src/Athena/ALTTPFile.cpp \ - src/Athena/ALTTPFileReader.cpp \ - src/Athena/ALTTPFileWriter.cpp \ - src/Athena/ALTTPQuest.cpp \ - src/Athena/Checksums.cpp \ - src/Athena/Compression.cpp \ - src/Athena/MCFile.cpp \ - src/Athena/MCFileReader.cpp \ - src/Athena/MCFileWriter.cpp \ - src/Athena/SkywardSwordFile.cpp \ - src/Athena/SkywardSwordFileReader.cpp \ - src/Athena/SkywardSwordFileWriter.cpp \ - src/Athena/SkywardSwordQuest.cpp \ - src/Athena/Sprite.cpp \ - src/Athena/SpriteFile.cpp \ - src/Athena/SpriteFileReader.cpp \ - src/Athena/SpriteFileWriter.cpp \ - src/Athena/SpriteFrame.cpp \ - src/Athena/SpritePart.cpp \ - src/Athena/WiiBanner.cpp \ - src/Athena/WiiFile.cpp \ - src/Athena/WiiImage.cpp \ - src/Athena/WiiSave.cpp \ - src/Athena/WiiSaveReader.cpp \ - src/Athena/WiiSaveWriter.cpp \ - src/Athena/ZQuestFile.cpp \ - src/Athena/ZQuestFileReader.cpp \ - src/Athena/ZQuestFileWriter.cpp \ - src/Athena/PHYSFSFileReader.cpp \ - src/LZ77/LZBase.cpp \ - src/LZ77/LZLookupTable.cpp \ - src/LZ77/LZType10.cpp \ - src/LZ77/LZType11.cpp \ - src/bn.cpp \ - src/ec.cpp \ - src/md5.cpp \ - src/sha1.cpp \ - src/aes.c \ - src/lzo.c -win32:SOURCES += src/win32_largefilewrapper.c - -INCLUDEPATH += \ - include - -HEADERS += \ - include/Athena/Global.hpp \ - include/Athena/Stream.hpp \ - include/Athena/Types.hpp \ - include/Athena/Utility.hpp \ - include/Athena/Exception.hpp \ - include/Athena/FileNotFoundException.hpp \ - include/Athena/IOException.hpp \ - include/Athena/InvalidDataException.hpp \ - include/Athena/InvalidOperationException.hpp \ - include/Athena/FileReader.hpp \ - include/Athena/FileWriter.hpp \ - include/Athena/BinaryReader.hpp \ - include/Athena/BinaryWriter.hpp \ - include/Athena/NotImplementedException.hpp \ - include/Athena/ALTTPEnums.hpp \ - include/Athena/ALTTPFile.hpp \ - include/Athena/ALTTPFileReader.hpp \ - include/Athena/ALTTPFileWriter.hpp \ - include/Athena/ALTTPQuest.hpp \ - include/Athena/ALTTPStructs.hpp \ - include/Athena/Checksums.hpp \ - include/Athena/Compression.hpp \ - include/Athena/MCFile.hpp \ - include/Athena/MCFileReader.hpp \ - include/Athena/MCFileWriter.hpp \ - include/Athena/SkywardSwordFile.hpp \ - include/Athena/SkywardSwordFileReader.hpp \ - include/Athena/SkywardSwordFileWriter.hpp \ - include/Athena/SkywardSwordQuest.hpp \ - include/Athena/Sprite.hpp \ - include/Athena/SpriteFile.hpp \ - include/Athena/SpriteFileReader.hpp \ - include/Athena/SpriteFileWriter.hpp \ - include/Athena/SpriteFrame.hpp \ - include/Athena/SpritePart.hpp \ - include/Athena/WiiBanner.hpp \ - include/Athena/WiiFile.hpp \ - include/Athena/WiiImage.hpp \ - include/Athena/WiiSave.hpp \ - include/Athena/WiiSaveReader.hpp \ - include/Athena/WiiSaveWriter.hpp \ - include/Athena/ZQuestFile.hpp \ - include/Athena/ZQuestFileReader.hpp \ - include/Athena/ZQuestFileWriter.hpp \ - include/Athena/PHYSFSFileReader.hpp \ - include/LZ77/LZBase.hpp \ - include/LZ77/LZLookupTable.hpp \ - include/LZ77/LZType10.hpp \ - include/LZ77/LZType11.hpp \ - include/utf8.h \ - include/utf8/checked.h \ - include/utf8/core.h \ - include/utf8/unchecked.h \ - include/aes.h \ - include/bn.h \ - include/ec.h \ - include/lzo.h \ - include/md5.h \ - include/sha1.h -win32:HEADERS += include/win32_largefilewrapper.h OTHER_FILES += \ .travis.yml -unix { - isEmpty(PREFIX) { - PREFIX = /usr/local - } - libFiles.path = $$PREFIX/lib - libFiles.files = $$PWD/lib/* - headerFiles.files = $$PWD/include/* - headerFiles.path = $$PREFIX/include/Athena - INSTALLS += libFiles headerFiles -} - -win32 { - isEmpty(PREFIX) { - PREFIX = $$PWD/pkg - } - - libFiles.path = $$PREFIX/lib - libFiles.files = $$PWD/lib/* - headerFiles.path = $$PREFIX/include/Athena - headerFiles.files = $$PWD/include/* - INSTALLS += libFiles headerFiles -} diff --git a/AthenaCore.pri b/AthenaCore.pri new file mode 100644 index 0000000..e9faa46 --- /dev/null +++ b/AthenaCore.pri @@ -0,0 +1,51 @@ +!contains($$INCLUDEPATH, $$PWD/include): { + INCLUDEPATH += $$PWD/include + unix:LIBS += -lz + win32:LIBS += -lzlib + QMAKE_CXXFLAGS += -std=c++11 +} + +SOURCES += \ + $$PWD/src/Athena/Utility.cpp \ + $$PWD/src/Athena/FileReader.cpp \ + $$PWD/src/Athena/FileWriter.cpp \ + $$PWD/src/Athena/BinaryReader.cpp \ + $$PWD/src/Athena/BinaryWriter.cpp \ + $$PWD/src/Athena/Global.cpp \ + $$PWD/src/Athena/Checksums.cpp \ + $$PWD/src/Athena/Compression.cpp \ + $$PWD/src/LZ77/LZLookupTable.cpp \ + $$PWD/src/LZ77/LZType10.cpp \ + $$PWD/src/LZ77/LZType11.cpp \ + $$PWD/src/LZ77/LZBase.cpp + +win32:SOURCES += $$PWD/src/win32_largefilewrapper.c + +HEADERS += \ + $$PWD/include/Athena/Stream.hpp \ + $$PWD/include/Athena/Types.hpp \ + $$PWD/include/Athena/Utility.hpp \ + $$PWD/include/Athena/Global.hpp \ + $$PWD/include/Athena/Exception.hpp \ + $$PWD/include/Athena/FileNotFoundException.hpp \ + $$PWD/include/Athena/IOException.hpp \ + $$PWD/include/Athena/InvalidDataException.hpp \ + $$PWD/include/Athena/InvalidOperationException.hpp \ + $$PWD/include/Athena/FileReader.hpp \ + $$PWD/include/Athena/FileWriter.hpp \ + $$PWD/include/Athena/BinaryReader.hpp \ + $$PWD/include/Athena/BinaryWriter.hpp \ + $$PWD/include/Athena/NotImplementedException.hpp \ + $$PWD/include/Athena/Checksums.hpp \ + $$PWD/include/Athena/Compression.hpp \ + $$PWD/include/LZ77/LZBase.hpp \ + $$PWD/include/LZ77/LZLookupTable.hpp \ + $$PWD/include/LZ77/LZType10.hpp \ + $$PWD/include/LZ77/LZType11.hpp \ + $$PWD/include/utf8.h \ + $$PWD/include/utf8/checked.h \ + $$PWD/include/utf8/core.h \ + $$PWD/include/utf8/unchecked.h + +win32:HEADERS += \ + $$PWD/include/win32_largefilewrapper.h diff --git a/AthenaSakura.pri b/AthenaSakura.pri new file mode 100644 index 0000000..3adb110 --- /dev/null +++ b/AthenaSakura.pri @@ -0,0 +1,19 @@ +!contains($$INCLUDEPATH, $$PWD/include): { + include(AthenaCore.pri) +} + +SOURCES += \ + $$PWD/src/Athena/Sprite.cpp \ + $$PWD/src/Athena/SpriteFile.cpp \ + $$PWD/src/Athena/SpriteFileReader.cpp \ + $$PWD/src/Athena/SpriteFileWriter.cpp \ + $$PWD/src/Athena/SpriteFrame.cpp \ + $$PWD/src/Athena/SpritePart.cpp + +HEADERS += \ + $$PWD/include/Athena/Sprite.hpp \ + $$PWD/include/Athena/SpriteFile.hpp \ + $$PWD/include/Athena/SpriteFileReader.hpp \ + $$PWD/include/Athena/SpriteFileWriter.hpp \ + $$PWD/include/Athena/SpriteFrame.hpp \ + $$PWD/include/Athena/SpritePart.hpp diff --git a/AthenaWiiSave.pri b/AthenaWiiSave.pri new file mode 100644 index 0000000..4db7025 --- /dev/null +++ b/AthenaWiiSave.pri @@ -0,0 +1,54 @@ +!contains($$INCLUDEPATH, $$PWD/include): { + include(AthenaCore.pri) +} + +SOURCES += \ + $$PWD/src/Athena/WiiBanner.cpp \ + $$PWD/src/Athena/WiiFile.cpp \ + $$PWD/src/Athena/WiiImage.cpp \ + $$PWD/src/Athena/WiiSave.cpp \ + $$PWD/src/Athena/WiiSaveReader.cpp \ + $$PWD/src/Athena/WiiSaveWriter.cpp \ + $$PWD/src/Athena/ZQuestFile.cpp \ + $$PWD/src/Athena/ZQuestFileReader.cpp \ + $$PWD/src/Athena/ZQuestFileWriter.cpp \ + $$PWD/src/bn.cpp \ + $$PWD/src/ec.cpp \ + $$PWD/src/md5.cpp \ + $$PWD/src/sha1.cpp \ + $$PWD/src/aes.c + +HEADERS += \ + $$PWD/include/Athena/ALTTPEnums.hpp \ + $$PWD/include/Athena/ALTTPFile.hpp \ + $$PWD/include/Athena/ALTTPFileReader.hpp \ + $$PWD/include/Athena/ALTTPFileWriter.hpp \ + $$PWD/include/Athena/ALTTPQuest.hpp \ + $$PWD/include/Athena/ALTTPStructs.hpp \ + $$PWD/include/Athena/Checksums.hpp \ + $$PWD/include/Athena/Compression.hpp \ + $$PWD/include/Athena/MCFile.hpp \ + $$PWD/include/Athena/MCFileReader.hpp \ + $$PWD/include/Athena/MCFileWriter.hpp \ + $$PWD/include/Athena/SkywardSwordFile.hpp \ + $$PWD/include/Athena/SkywardSwordFileReader.hpp \ + $$PWD/include/Athena/SkywardSwordFileWriter.hpp \ + $$PWD/include/Athena/SkywardSwordQuest.hpp \ + $$PWD/include/Athena/Sprite.hpp \ + $$PWD/include/Athena/SpriteFile.hpp \ + $$PWD/include/Athena/SpriteFileReader.hpp \ + $$PWD/include/Athena/SpriteFileWriter.hpp \ + $$PWD/include/Athena/SpriteFrame.hpp \ + $$PWD/include/Athena/SpritePart.hpp \ + $$PWD/include/Athena/WiiBanner.hpp \ + $$PWD/include/Athena/WiiFile.hpp \ + $$PWD/include/Athena/WiiImage.hpp \ + $$PWD/include/Athena/WiiSave.hpp \ + $$PWD/include/Athena/WiiSaveReader.hpp \ + $$PWD/include/Athena/WiiSaveWriter.hpp \ + $$PWD/include/aes.h \ + $$PWD/include/bn.h \ + $$PWD/include/ec.h \ + $$PWD/include/lzo.h \ + $$PWD/include/md5.h \ + $$PWD/include/sha1.h diff --git a/AthenaZelda.pri b/AthenaZelda.pri new file mode 100644 index 0000000..58419c1 --- /dev/null +++ b/AthenaZelda.pri @@ -0,0 +1,44 @@ +!contains($$INCLUDEPATH, $$PWD/include): { + include(AthenaCore.pri) +} + +SOURCES += \ + $$PWD/src/Athena/ALTTPFile.cpp \ + $$PWD/src/Athena/ALTTPFileReader.cpp \ + $$PWD/src/Athena/ALTTPFileWriter.cpp \ + $$PWD/src/Athena/ALTTPQuest.cpp \ + $$PWD/src/Athena/MCFile.cpp \ + $$PWD/src/Athena/MCFileReader.cpp \ + $$PWD/src/Athena/MCFileWriter.cpp \ + $$PWD/src/Athena/MCSlot.cpp \ + $$PWD/src/Athena/SkywardSwordFile.cpp \ + $$PWD/src/Athena/SkywardSwordFileReader.cpp \ + $$PWD/src/Athena/SkywardSwordFileWriter.cpp \ + $$PWD/src/Athena/SkywardSwordQuest.cpp \ + $$PWD/src/Athena/ZQuestFile.cpp \ + $$PWD/src/Athena/ZQuestFileReader.cpp \ + $$PWD/src/Athena/ZQuestFileWriter.cpp + +HEADERS += \ + $$PWD/include/Athena/ALTTPEnums.hpp \ + $$PWD/include/Athena/ALTTPFile.hpp \ + $$PWD/include/Athena/ALTTPFileReader.hpp \ + $$PWD/include/Athena/ALTTPFileWriter.hpp \ + $$PWD/include/Athena/ALTTPQuest.hpp \ + $$PWD/include/Athena/ALTTPStructs.hpp \ + $$PWD/include/Athena/MCFile.hpp \ + $$PWD/include/Athena/MCFileReader.hpp \ + $$PWD/include/Athena/MCFileWriter.hpp \ + $$PWD/include/Athena/SkywardSwordFile.hpp \ + $$PWD/include/Athena/SkywardSwordFileReader.hpp \ + $$PWD/include/Athena/SkywardSwordFileWriter.hpp \ + $$PWD/include/Athena/SkywardSwordQuest.hpp \ + $$PWD/include/Athena/Sprite.hpp \ + $$PWD/include/Athena/SpriteFile.hpp \ + $$PWD/include/Athena/SpriteFileReader.hpp \ + $$PWD/include/Athena/SpriteFileWriter.hpp \ + $$PWD/include/Athena/SpriteFrame.hpp \ + $$PWD/include/Athena/SpritePart.hpp \ + $$PWD/include/Athena/ZQuestFile.hpp \ + $$PWD/include/Athena/ZQuestFileReader.hpp \ + $$PWD/include/Athena/ZQuestFileWriter.hpp