SBSPSS/makefile.gaz

403 lines
10 KiB
Plaintext
Raw Normal View History

2000-08-29 18:28:00 +02:00
#----------------------------------------------------------------------------
# MAKEFILE
#
# Controlling makefile for Power Rangers Light Speed Rescue PSX
#
# Tabbed for 5 9 (Please do not change)
#
# Created: 3rd February 1999 GRLiddon()
#
# Copyright (C) 1997-1999 G R Liddon
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Default Target
# --------------
.PHONY: default
default : all
#----------------------------------------------------------------------------
# Name of the project
# --------------------
2000-08-29 22:33:18 +02:00
PROJ := Spongey
2000-08-29 18:28:00 +02:00
#----------------------------------------------------------------------------
USE_EGCS := 1
BUILD_DIR := build
#----------------------------------------------------------------------------
# Includes
# --------
include $(BUILD_DIR)/globals.mak
include $(BUILD_DIR)/getuser.mak
include $(BUILD_DIR)/parse.mak
#----------------------------------------------------------------------------
# File Sys specifics
#----------------------------------------------------------------------------
PC_FILESYS_SRC := pcfile
PC_STARTUP_OBJ :=
PC_FILESYS_LIB := libsn
CD_FILESYS_SRC := cdfile
2001-01-25 16:45:15 +01:00
CD_STARTUP_OBJ := BootObj\snmain
2000-08-29 18:28:00 +02:00
CD_FILESYS_LIB := CMXBoot
#----------------------------------------------------------------------------
# Source Code to Compile
#----------------------------------------------------------------------------
2001-01-11 23:06:59 +01:00
backend_src := gameover \
complete
2001-01-16 17:20:45 +01:00
enemy_src := 2denemy \
2001-01-16 20:36:19 +01:00
npc \
2001-02-01 21:25:58 +01:00
npcdata \
2001-01-18 20:18:39 +01:00
npcpath \
2001-01-18 22:19:43 +01:00
nsjfish \
nclam \
2001-01-19 22:46:30 +01:00
nscrab \
ngpirate \
nshrkman \
2001-01-22 15:23:11 +01:00
ngeneric \
2001-01-22 17:02:38 +01:00
nanemone \
2001-01-22 23:24:53 +01:00
neyeball \
2001-01-23 18:03:27 +01:00
nsstomp \
2001-01-23 20:58:19 +01:00
nbooger \
2001-01-25 16:45:15 +01:00
nmjfish \
nfdutch \
2001-01-25 18:20:08 +01:00
nsshark \
2001-01-25 20:57:29 +01:00
ndogfish \
2001-01-29 17:55:11 +01:00
nhazard \
2001-02-05 15:55:11 +01:00
nffolk \
2001-02-06 17:14:16 +01:00
nocto \
2001-02-06 20:29:35 +01:00
nfskull \
2001-01-16 17:20:45 +01:00
enemy
2001-01-10 22:46:46 +01:00
2001-01-22 17:02:38 +01:00
projectl_src := projectl
2000-08-29 18:28:00 +02:00
fileio_src := fileio \
$($(FILE_SYSTEM)_FILESYS_SRC)
2000-11-24 18:30:49 +01:00
frontend_src := credits \
demomode \
2000-11-24 01:00:10 +01:00
frontend \
2000-11-22 18:02:04 +01:00
maintitl \
2000-11-24 18:30:49 +01:00
options \
scrollbg \
start
2000-11-13 18:03:20 +01:00
2001-01-05 22:43:21 +01:00
game_src := game \
2001-01-26 17:43:34 +01:00
gamebubs \
2001-01-10 23:03:20 +01:00
gameslot \
2001-01-10 22:46:46 +01:00
thing \
2001-01-05 22:43:21 +01:00
convo
2000-08-29 18:28:00 +02:00
gfx_src := prim \
tpage \
animtex \
2000-08-29 22:33:18 +02:00
sprbank \
2000-11-15 16:37:12 +01:00
fader \
2000-10-18 00:04:57 +02:00
fdata \
2000-11-15 16:37:12 +01:00
font \
2001-01-10 22:46:46 +01:00
bubicles \
skel \
2001-02-02 18:19:51 +01:00
skelspng \
2001-01-10 22:46:46 +01:00
anim
2000-08-29 18:28:00 +02:00
2000-08-29 22:33:18 +02:00
# camera \
# basemod \
# skel \
# anim \
# bilboard
2000-08-29 18:28:00 +02:00
2001-01-12 22:17:20 +01:00
gui_src := gbubbles \
gbutton \
2000-11-22 23:52:08 +01:00
gfactory \
2000-11-02 18:16:10 +01:00
gframe \
2000-10-31 17:43:44 +01:00
greadout \
2000-11-24 17:41:51 +01:00
gsprite \
gtextbox \
gui
2000-10-31 17:43:44 +01:00
2000-12-07 16:56:20 +01:00
level_src := level \
2000-12-12 21:56:51 +01:00
layertile \
2001-01-15 16:22:33 +01:00
layerback \
2000-12-14 17:38:34 +01:00
layertilesolid \
2001-02-02 20:16:49 +01:00
layertile3d \
layercollision
2001-01-25 16:45:15 +01:00
2000-08-29 18:28:00 +02:00
locale_src := textdbase
mem_src := memory
2001-01-03 16:57:20 +01:00
memcard_src := md5 \
memcard \
saveload
2000-08-29 22:33:18 +02:00
pad_src := pads
2000-08-29 18:28:00 +02:00
2001-01-11 18:09:44 +01:00
paul_src := paul \
scenesel
2000-09-12 01:41:29 +02:00
2001-02-09 18:01:04 +01:00
player_src := demoplay \
panimsfx \
2001-02-01 18:01:12 +01:00
player \
2001-01-26 19:20:41 +01:00
pmodes \
2001-01-22 22:02:59 +01:00
psbutt \
pschop \
2001-02-06 22:09:45 +01:00
psdead \
2001-01-22 22:02:59 +01:00
psduck \
2001-01-20 00:37:40 +01:00
psfall \
2001-01-25 16:25:46 +01:00
psidle \
2001-01-20 00:37:40 +01:00
psjump \
psrun \
pstates
2001-01-10 22:46:46 +01:00
2000-12-15 21:29:33 +01:00
script_src := script \
function
2000-12-12 22:33:19 +01:00
2000-10-05 16:16:09 +02:00
sound_src := sound \
spu \
xmplay \
cdxa
2000-08-29 18:28:00 +02:00
system_src := main \
gstate \
vid \
2000-09-12 01:41:29 +02:00
dbg \
2000-10-05 16:16:09 +02:00
vsprintf \
2000-10-20 23:52:46 +02:00
clickcount \
except
2000-08-29 18:28:00 +02:00
utils_src := utils \
2000-08-29 22:33:18 +02:00
sincos
2000-08-29 18:28:00 +02:00
utils_src_mip := quatmip \
mathmip \
replace
2000-10-20 23:52:46 +02:00
system_src_mip := except_a \
gp \
2000-08-29 18:28:00 +02:00
lnkopt \
$(VERSION)/$(TERRITORY)/$(FILE_SYSTEM)/info
#
# Compile Build Lists
# ----------------------------
SRC_DIRS := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/*))
ALL_ASM_OBJS := $(foreach SRC_DIR,$(SRC_DIRS),$(foreach FILE,$($(SRC_DIR)_src_mip),$(SRC_DIR)/$(FILE).o))
ALL_CPP_OBJS := $(foreach SRC_DIR,$(SRC_DIRS),$(foreach FILE,$($(SRC_DIR)_src),$(SRC_DIR)/$(FILE).o))
ALL_CODE_OBJS := $(ALL_ASM_OBJS) $(ALL_CPP_OBJS)
#----------------------------------------------------------------------------
# Libraries we need
#----------------------------------------------------------------------------
include $(BUILD_DIR)/outdirs.mak
#----------------------------------------------------------------------------
# Libraries we need
#----------------------------------------------------------------------------
PSX_LIBS := libc libapi libetc libspu libsnd \
libgpu libcard libpress \
libcd libtap libcomb libmcrd \
libgte libpad libds
MOD_LIBS := xmplay
PSX_LIBS_FULL := $(foreach FILE,$(PSX_LIBS),$(PSYQ_LIB_DIR)/$(FILE).lib)
FILESYS_LIBS_FULL := $(foreach FILE,$($(FILE_SYSTEM)_FILESYS_LIB),$(PSYQ_LIB_DIR)/$(FILE).lib)
MOD_LIBS_FULL := $(foreach FILE,$(MOD_LIBS),$(MOD_LIB_DIR)/$(FILE).lib)
ALL_LIBS_FULL := $(PSX_LIBS_FULL) $(MOD_LIBS_FULL) $(FILESYS_LIBS_FULL)
EXTRA_OBJS := $(VLC_LIB_DIR)/vlc_bit.o
#----------------------------------------------------------------------------
# Do all the stuff we need to do to build the source code into obj files
#----------------------------------------------------------------------------
.PHONY : code cleancode
# Cpp files first
# ---------------
include $(BUILD_DIR)/ccopt.mak
$(OBJ_DIR)/%.o : $(SOURCE_DIR)/%.cpp
@$(ECHO) Compiling $<
@$(CC) -c $(COMMON_CCFLAGS) $< -o a.o
@dmpsx -b a.o
@objbodge a.o $@
@$(RM) a.o
# Stuff to make Info.mip
# ----------------------
arse: $(SOURCE_DIR)/system/$(VERSION)/$(TERRITORY)/$(FILE_SYSTEM)/info.mip
$(SOURCE_DIR)/system/$(VERSION)/$(TERRITORY)/$(FILE_SYSTEM)/info.mip : makefile.gaz $(USER_VAR_FILE)
@$(REDIR) $@ \
'$(TAB)section .rdata' \
'$(TAB)global INF_Version' \
'$(TAB)global INF_Territory' \
'$(TAB)global INF_FileSystem' \
'INF_Version db &$(VERSION)&,0' \
'INF_Territory db &$(TERRITORY)&,0' \
'INF_FileSystem db &$(FILE_SYSTEM)&,0'
# Assembly here
# -------------
$(OBJ_DIR)/%.o : $(SOURCE_DIR)/%.mip
@$(ECHO) Assembling $<
@$(ASM) $(ASM_OPTS) $<,$@
# Overal stuff here
# -----------------
CODE_OBJS_TO_MAKE := $(foreach FILE,$(ALL_CODE_OBJS),$(OBJ_DIR)/$(FILE))
code : $(CODE_OBJS_TO_MAKE)
cleancode :
@$(RM) -f $(CODE_OBJS_TO_MAKE)
@$(ECHO) Cleaned code output
#----------------------------------------------------------------------------
# Do all the stuff we need to make our CPE, MAP and EXE files
#----------------------------------------------------------------------------
.PHONY: link cleanlink
include $(BUILD_DIR)/lnk.mak
CPE_FILE := $(VERSION_DIR)/$(PROJ).cpe
MAP_FILE := $(VERSION_DIR)/$(PROJ).map
SYM_FILE := $(VERSION_DIR)/$(PROJ).sym
LINK_FILE := $(TEMP_DIR)/$(PROJ).ln
$(LINK_FILE) : makefile.gaz $(BUILD_DIR)/lnk.mak $(USER_VAR_FILE)
@$(REDIR) $(LINK_FILE) $(LINKER_FILE_MACRO)
LINK_FILES_TO_MAKE := $(CPE_FILE) $(MAP_FILE) $(SYM_FILE)
$(LINK_FILES_TO_MAKE) : $(LINK_FILE) $(ALL_LIBS_FULL) $(CODE_OBJS_TO_MAKE)
@$(LNK) $(LNK_FLAGS) @$(LINK_FILE),$(CPE_FILE),$(SYM_FILE),$(MAP_FILE)
symmunge $(SYM_FILE)
2000-12-12 21:56:51 +01:00
ifeq ($(USER_NAME),daveox)
2000-08-29 18:28:00 +02:00
@cp stats.txt '$(SIZES_DIR)/$(shell $(DATE) '+%d-%m-%Y_%H-%M-%S')'
endif
link : $(LINK_FILES_TO_MAKE)
cleanlink :
@$(RM) -f $(LINK_FILES_TO_MAKE) $(LINK_FILE)
@$(ECHO) Cleaned link output
#----------------------------------------------------------------------------
# Stuff so you can clean individual files
#----------------------------------------------------------------------------
MAKE_TARGETS := $(subst /,.,$(patsubst %.o,%,$(foreach FILE,$(ALL_CODE_OBJS),$(FILE))))
CLEAN_TARGETS := $(addprefix clean.,$(MAKE_TARGETS))
.PHONY: $(CLEAN_TARGETS)
.PHONY: $(MAKE_TARGETS)
$(CLEAN_TARGETS) :
@$(RM) -f $(addprefix $(OBJ_DIR)/,$(addsuffix .o,$(subst .,/,$(subst clean.,,$@))))
@$(ECHO) Cleaned $(addprefix $(OBJ_DIR)/,$(addsuffix .o,$(subst .,/,$(subst clean.,,$@))))
$(MAKE_TARGETS) :
$(MAKE) -r -f makefile.gaz VERSION=$(VERSION) TERRITORY=$(TERRITORY) clean.$@
$(MAKE) -r -f makefile.gaz VERSION=$(VERSION) TERRITORY=$(TERRITORY) $(OBJ_DIR)/$(subst .,/,$@).o
#----------------------------------------------------------------------------
# This bit does everything needed for generating autodependancies
#----------------------------------------------------------------------------
ALL_CODE_DEPS := $(patsubst %.o,%.d,$(addprefix $(DEPS_DIR)/,$(ALL_CODE_OBJS)))
$(DEPS_DIR)/%.d : $(SOURCE_DIR)/%.cpp
@$(MKDIR) -p $(dir $@)
-@$(CC) -M $(COMMON_CCFLAGS) $< -o $(TEMP_DIR)/deps.tmp
@$(PL) $(PERL_SCRIPT_DIR)/dep.pl $(TEMP_DIR)/deps.tmp $@ $(OBJ_DIR)/$(subst .cpp,.o,$(subst $(SOURCE_DIR)/,,$<))
@$(RM) $(TEMP_DIR)/deps.tmp
@$(ECHO) Generated autodependancies for $<
deps : $(ALL_CODE_DEPS)
@echo Made deps
#ifndef NODEPS
include $(ALL_CODE_DEPS)
#endif
$(DEPS_DIR)/%.d : $(SOURCE_DIR)/%.mip
@$(REDIR) $@ '#'
cleandeps :
@$(RM) -f $(ALL_CODE_DEPS)
#----------------------------------------------------------------------------
# Boot strap stuff
#----------------------------------------------------------------------------
CD_DIR := CdBuild/$(TERRITORY)
BIGLUMP_FILE := $(VERSION_DIR)/BIGLUMP.BIN
2000-08-29 22:33:18 +02:00
BIN_OUTFILE := SPONGEY.BIN
2000-08-29 18:28:00 +02:00
BOOTSTRAP_DIR := source/psxboot/
BOOTSTRAP_IN := $(BOOTSTRAP_DIR)/PsxBoot.cpp
BOOTSTRAP_CPE := $(TEMP_DIR)/PsxBoot.cpe
BOOTSTRAP_MAP := $(TEMP_DIR)/PsxBoot.map
BOOTSTRAP_SYM := $(TEMP_DIR)/PsxBoot.sym
BOOTSTRAP_EXE := $(TEMP_DIR)/PsxBoot.exe
2001-01-19 17:07:08 +01:00
USA_BOOTSTRAP_OUT :=$(CD_DIR)/BOOTUSA.EXE
2000-08-29 18:28:00 +02:00
USA_CPE2X_PARAM :=/CA
2001-01-19 17:07:08 +01:00
EUR_BOOTSTRAP_OUT :=$(CD_DIR)/BOOTEUR.EXE
2000-08-29 18:28:00 +02:00
EUR_CPE2X_PARAM :=/CE
cddata:
ifeq ($(USER_NAME),CDBUILD)
@$(MKDIR) -p $(CD_DIR)
@$(CPE2BIN) $(CPE_FILE) $(CD_DIR)/$(BIN_OUTFILE)
@$(CP) $(BIGLUMP_FILE) $(CD_DIR) -f
@alchemy --n -a -15 -^ -o graphics/screens/legal.tga $(TEMP_DIR)/pic.tmp
@chopchop $(TEMP_DIR)/pic.tmp $(CD_DIR)/LEGAL.GFX 20 262144
# Compile bootstrap
@ccpsx -O2 -g $(BOOTSTRAP_IN) -c -Xo$801c0000 $(COMMON_CCFLAGS) -oPsxBoot.o
@slink -m -psx -c -v -z -o 0x801c0000 -cpemunge -we -wm -wo @$(BOOTSTRAP_DIR)/psxboot.ln,$(BOOTSTRAP_CPE),$(BOOTSTRAP_SYM),$(BOOTSTRAP_MAP)
@$(RM) PsxBoot.o
2001-01-25 16:45:15 +01:00
Cpe2Exe $($(TERRITORY)_CPE2X_PARAM) $(BOOTSTRAP_CPE)
2000-08-29 18:28:00 +02:00
@$(CP) $(BOOTSTRAP_EXE) $($(TERRITORY)_BOOTSTRAP_OUT) -f
@$(CP) Data/$(TERRITORY).cnf $(CD_DIR)/SYSTEM.CNF -f
@$(ECHO) $(TERRITORY) CD Built
endif
#----------------------------------------------------------------------------
# Main dependancy
# ---------------
ifdef ERR_STR
all:
@$(ECHO) Error: $(ERR_STR)
else
all: dirs link cddata
@$(ECHO) Built !$(TERRITORY):$(VERSION):$(FILE_SYSTEM)!.
.PHONY: clean
clean : cleanlink cleandeps cleancode
@$(ECHO) Cleaning complete
endif
#----------------------------------------------------------------------------
# end---