Files
wagic/JGE/Makefile
wagic.the.homebrew e27cf56fa2 - Support for Zip Filesystem. It is now possible to zip the entire Res folder ("store" method preferred, zip so that the root of the zip has ai, player, etc...) in one single file for read only. Write access is done in another folder (hardcoded to be User/ for now, can be updated depending on platforms, etc...
-- zipFS has several limitations...
--- in a general way, seekg doesn't work... so getting a file's size needs to be done through JFileSystem.
--- getLine on files open with zipFS doesn't work so great. Not sure if it is a normal issue because files are open in binary or not... JFileSystem therefore offers a "readIntoString" function that needs to be used instead of the usual "getline" technique. However getLine can then be used on a stream connected to the string.

-- tested on Windows and PSP, I also made sure android still works, but haven't tested zip support on Android.
-- I tried to maintain backwards compatibility, but this might break on some platforms, if I broke some platforms and you can't find a way to fix them, please contact me and we'll figure something out
-- This removes wagic::ifstream. I didn't reimplement the securities that were involved in this, apologies for that. Might be useful to reimplement such securities in JFileSystem
-- I haven't tested options/profiles in a deep way, it is possible I broke that.
2011-08-21 09:04:59 +00:00

130 lines
3.1 KiB
Makefile

ifeq ($(MAKECMDGOALS),debug)
DEBUG = true
endif
ifeq ($(MAKECMDGOALS),log)
DOLOG = true
endif
GENERIC_OBJS = src/JApp.o src/JGBKFont.o \
src/JGE.o src/JGui.o src/JLBFont.o \
src/JLogger.o \
src/JGameObject.o src/JSpline.o src/JAnimator.o \
src/JResourceManager.o src/JFileSystem.o \
src/JNetwork.o \
src/JParticle.o src/JParticleEmitter.o src/JParticleEffect.o \
src/JParticleSystem.o \
src/zipFS/zfsystem.o src/zipFS/ziphdr.o src/zipFS/zstream.o \
src/JSprite.o src/Vector2D.o \
src/tinyxml/tinystr.o src/tinyxml/tinyxml.o \
src/tinyxml/tinyxmlparser.o src/tinyxml/tinyxmlerror.o \
src/Encoding.o src/JTTFont.o \
src/JMD2Model.o src/JOBJModel.o
PSP_OBJS = src/JSocket.o src/JGfx.o src/JSfx.o src/JAudio.o src/JMP3.o src/decoder_prx.o src/main.o src/vram.o
LINUX_OBJS = src/pc/JGfx.o src/pc/JSfx.o src/Xmain.o
HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
src/hge/hgerect.o src/hge/hgevector.o \
src/hge/hgedistort.o src/hge/hgefont.o
CXXFLAGS = -W -Wall -Werror -Wno-unused
ifdef DEBUG
CXXFLAGS += -ggdb3
endif
ifdef DOLOG
CXXFLAGS += -DDOJLOG
endif
# Determination of target.
# TARGET_ARCHITECTURE variable will then be set to either linux or psp.
RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache)
ifeq ($(RESULT),)
DEFAULT_RULE = linux
TARGET_ARCHITECTURE = linux
else
DEFAULT_RULE = 3xx
TARGET_ARCHITECTURE = psp
TARGET_LIB = libjge300.a
endif
ifeq ($(MAKECMDGOALS),linux)
DEFAULT_RULE = linux
TARGET_ARCHITECTURE = linux
endif
ifeq ($(MAKECMDGOALS),3xx)
DEFAULT_RULE = 3xx
endif
ifeq ($(DEFAULT_RULE),3xx)
TARGET_ARCHITECTURE = psp
TARGET_LIB = libjge300.a
CXXFLAGS += -DDEVHOOK -DPSPFW3XX
PSP_FW_VERSION=371
endif
ifeq ($(TARGET_ARCHITECTURE),psp)
PSPSDK = $(shell psp-config --pspsdk-path)
PSPDIR = $(shell psp-config --psp-prefix)
OBJS = $(GENERIC_OBJS) $(PSP_OBJS)
TARGET_HGE = libhgetools.a
INCDIR = include/psp include/psp/freetype2 ../Boost src/zipFS
CXXFLAGS += -O2 -G0 -DPSP
LIBDIR = lib/psp
endif
ifeq ($(TARGET_ARCHITECTURE),linux)
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
TARGET_LIB = libjge.a
TARGET_HGE = libhgetools.a
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I../Boost
CXXFLAGS += -DLINUX $(FMOD)
CXXFLAGS += $(INCDIR)
LIBDIR = lib/linux
endif
# Set definitive values for variables.
TARGET_LIB := $(LIBDIR)/$(TARGET_LIB)
TARGET_HGE := $(LIBDIR)/$(TARGET_HGE)
ifeq ($(TARGET_ARCHITECTURE),psp)
include $(PSPSDK)/lib/build.mak
endif
all: $(DEFAULT_RULE) Makefile.$(TARGET_ARCHITECTURE) hge
debug: $(DEFAULT_RULE) hge
linux: $(TARGET_LIB) hge
3xx: $(TARGET_LIB)
install: $(TARGET_LIB) hge
hge: $(TARGET_HGE)
ifeq ($(TARGET_ARCHITECTURE),linux)
$(TARGET_LIB): $(OBJS)
ar r $(TARGET_LIB) $(OBJS)
$(TARGET_HGE): $(HGE_OBJS)
ar r $(TARGET_HGE) $(HGE_OBJS)
clean:
$(RM) -f $(OBJS) $(HGE_OBJS) Makefile.$(TARGET_ARCHITECTURE)
endif
Makefile.psp:
echo #Makefile.psp > $@
Makefile.linux:
$(CXX) -o /dev/null src/testfeatures.c -L$(LIBDIR) -lfmod-3.75 > /dev/null 2>&1 ; if [ "0" = "$$?" ]; then echo 'FMOD=-DWITH_FMOD'; else echo 'FMOD=-DWITHOUT_FMOD'; fi > $@
-include Makefile.$(TARGET_ARCHITECTURE)