Files
wagic/JGE/Makefile
jean.chalard 18c18822c9 J :
* This update has Wagic compile and work under Darwin 64-bits.
  - Linux 64-bits is expected to compile and work from now on, but
    was not tested. As with before, Linux 64 bits can still run
    the 32 bits version.
  - Darwin version is not using Carbon but X emulation.
  - 64-bits versions have no sound because there is no 64-bits
    version of fmod.
  - Windows 64-bits probably does not compile. Windows 64-bits can
    still run the 32 bits version.
  - Darwin 32-bits probably does not work at the moment because the
    libfmod requires another name to work on Macs, but as 64-bits
    disables it it works.
  - Other unix flavors are expected to work as long as they have
    a working OpenGL library, X11, and *either* 64-bits *or* a
    working fmod. Thus in the practice Tru64, Irix and the like
    probably work, as should FreeBSD and other BSDs in 64 bits
    versions, but 32 bits versions will search for a non-existing
    fmod. All of this is pure conjecture and none was tested.
  - All 64-bits versions have no sound.
  - The mac version does not display the particles at the moment.
    This is not critical, but the cause is unknown yet. I would
    like to know if other 64 bits unices share the same bug or if
    it is mac-specific.
* Test is needed in particular to see whether the program still
  compiles and works in Linux and PSP. Windows is probably all
  right, but compiling PSP in windows may be broken by this
  update.
2010-02-02 08:27:10 +00:00

128 lines
3.1 KiB
Makefile

ifeq ($(MAKECMDGOALS),debug)
DEBUG = true
endif
GENERIC_OBJS = src/JApp.o src/JGBKFont.o \
src/JGE.o src/JGui.o src/JLBFont.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/unzip/ioapi.o src/unzip/mztools.o src/unzip/unzip.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
# 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 ($(MAKECMDGOALS),1xx)
DEFAULT_RULE = 1xx
endif
ifeq ($(DEFAULT_RULE),3xx)
TARGET_ARCHITECTURE = psp
TARGET_LIB = libjge300.a
CXXFLAGS += -DDEVHOOK -DPSPFW3XX
PSP_FW_VERSION=371
endif
ifeq ($(DEFAULT_RULE),1xx)
OBJS = $(GENERIC_OBJS) $(PSP_OBJS)
TARGET_LIB = libjge100.a
TARGET_ARCHITECTURE = psp
PSP_FW_VERSION=150
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
CXXFLAGS += -O2 -G0
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
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)
1xx: $(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.linux:
g++ -o /dev/null src/testfeatures.c -L$(LIBDIR) -lfmod-3.75
@if [ "0" == "$?" ]; then echo 'FMOD=-DWITH_FMOD'; else echo 'FMOD=-DWITHOUT_FMOD'; fi > $@
-include Makefile.$(TARGET_ARCHITECTURE)