SBSPSS/makefile.gfx
2000-11-28 00:06:22 +00:00

296 lines
9.9 KiB
Plaintext

#----------------------------------------------------------------------------
# MAKEFILE.GFX
#
# Makes all the graphics and data needed for the game
#
# Tabbed for 5 9 (Please do not change)
#
# Created: 10th February 1999 GRLiddon()
#
# Copyright (C) 1997-1999 G R Liddon
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Default Target
# --------------
.PHONY: default
default: all
#----------------------------------------------------------------------------
# Name of the project
# --------------------
PROJ := spongey
#----------------------------------------------------------------------------
BUILD_DIR := build
#----------------------------------------------------------------------------
# Includes
# --------
include $(BUILD_DIR)/globals.mak
include $(BUILD_DIR)/getuser.mak
include $(BUILD_DIR)/parse.mak
include $(BUILD_DIR)/outdirs.mak
TEMP_FILE := $(TEMP_BUILD_DIR)/build.tmp
#----------------------------------------------------------------------------
# Text translations
#----------------------------------------------------------------------------
.PHONY: translate cleantranslate
LANGUAGES := swe \
dut \
ita \
ger
TRANS_IN_DIR := $(GAME_DATA_DIR)/translations
TRANS_OUT_DIR := $(DATA_OUT)/translations
TRANS_LBM_OUT_DIR := $(REPORT_DIR)/translations
TRANS_IN_ENG := $(TRANS_IN_DIR)/text.dat
TRANS_FINAL_DAT_FILE := $(TRANS_OUT_DIR)/final.dat
ALL_TRANS_OUT_DIRS := $(TRANS_OUT_DIR) \
$(TRANS_LBM_OUT_DIR)
ALL_TRANS_IN_FILES := $(foreach FILE,$(LANGUAGES),$(TRANS_IN_DIR)/$(FILE).dat)
TRANS_IN_FILES := $(TRANS_IN_ENG) $(ALL_TRANS_IN_FILES)
TRANS_OUT_DAT := $(foreach FILE, $(LANGUAGES),$(TRANS_OUT_DIR)/$(FILE).dat) $(TRANS_OUT_DIR)/id.dat $(TRANS_OUT_DIR)/eng.dat
#$(TRANS_OUT_KANJI_TAB)
TRANS_OUT_HDR := $(INC_DIR)/trans.h
TRANS_OUT_FILES := $(TRANS_OUT_HDR) $(TRANS_OUT_DAT) $(TRANS_OUT_LBM_LIST) $(TRANS_FINAL_DAT_FILE)
$(TRANS_OUT_FILES) : $(TRANS_IN_FILES)
perl tools/perl/pl/lang.pl $(TRANS_IN_ENG) $(TRANS_FINAL_DAT_FILE) $(ALL_TRANS_IN_FILES)
transtext $(LANG_OP) -h:$(TRANS_OUT_HDR) -o:$(TRANS_OUT_DIR) $(TRANS_FINAL_DAT_FILE)
translate : $(TRANS_OUT_FILES)
@$(ECHO) made translations
cleantranslate:
@$(RM) -f $(TRANS_OUT_FILES)
GFX_DATA_OUT += $(TRANS_OUT_DAT)
#----------------------------------------------------------------------------
#--- UI ---------------------------------------------------------------------
#----------------------------------------------------------------------------
UI_GFX_DIR := $(GRAF_DIR)/ui
UI_GFX_OUT_DIR := $(DATA_OUT)/ui
UI_GFX_FONT := font
UI_GFX_FONT_IN := $(foreach FILE,$(UI_GFX_FONT),$(UI_GFX_DIR)/$(FILE).anm)
UI_GFX_NONTRANS :=
UI_GFX_NONTRANS_IN := $(foreach FILE,$(UI_GFX_NONTRANS),$(UI_GFX_DIR)/$(FILE))
UI_GFX_TRANS := +vbamboo.bmp +hbamboo.bmp \
+butU.bmp +butD.bmp +butL.bmp +butR.bmp \
+butC.bmp +butS.bmp +butX.bmp +butT.bmp
# +cross.bmp +tick.bmp
UI_GFX_TRANS_IN := $(foreach FILE,$(UI_GFX_TRANS),$(UI_GFX_DIR)/$(FILE))
UI_GFX_TEX_IN := $(UI_GFX_FONT_IN) ${UI_GFX_NONTRANS_IN} ${UI_GFX_TRANS_IN}
UI_GFX_TEX_OUT := $(UI_GFX_OUT_DIR)/UIGfx.Spr
UI_GFX_REP_FILE := $(REPORT_DIR)/UIGfx.rep
UI_GFX_HDR_FILE := $(INC_DIR)/UIGfx.h
cleanui :
$(RM) -f $(UI_GFX_TEX_OUT)
ui: $(UI_GFX_TEX_IN)
$(UI_GFX_TEX_OUT) : $(UI_GFX_TEX_IN)
@parkgrab -c+ -z+ $(UI_GFX_FONT_IN) ${UI_GFX_TRANS_IN} -c- -z- ${UI_GFX_NONTRANS_IN} -b+ -t:31,1,1 -l:$(REPORT_DIR)/ui.lbm -o:$(UI_GFX_TEX_OUT) -k:$(UI_GFX_REP_FILE)
@$(MV) -f $(UI_GFX_OUT_DIR)/uigfx.h $(UI_GFX_HDR_FILE)
GFX_DATA_OUT += $(UI_GFX_TEX_OUT)
#----------------------------------------------------------------------------
# Ingame graphic effects
#----------------------------------------------------------------------------
INGAMEFX_GFX_DIR := $(GRAF_DIR)/ingamefx
INGAMEFX_GFX_OUT_DIR := $(DATA_OUT)/ingamefx
INGAMEFX_GFX_NONTRANS :=
INGAMEFX_GFX_NONTRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_NONTRANS),$(INGAMEFX_NONTRANS_DIR)/$(FILE))
INGAMEFX_GFX_TRANS := +bubble_1.bmp +bubble_2.bmp +bubble_3.bmp
INGAMEFX_GFX_TRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_TRANS),$(INGAMEFX_GFX_DIR)/$(FILE))
INGAMEFX_GFX_TEX_IN := ${INGAMEFX_GFX_NONTRANS_IN} ${INGAMEFX_GFX_TRANS_IN}
INGAMEFX_GFX_TEX_OUT := $(INGAMEFX_GFX_OUT_DIR)/ingamefx.Spr
INGAMEFX_GFX_REP_FILE := $(REPORT_DIR)/ingamefx.rep
INGAMEFX_GFX_HDR_FILE := $(INC_DIR)/ingamefx.h
cleaningamefx :
$(RM) -f $(INGAMEFX_GFX_TEX_OUT)
ingamefx: $(INGAMEFX_GFX_TEX_IN)
$(INGAMEFX_GFX_TEX_OUT) : $(INGAMEFX_GFX_TEX_IN)
@parkgrab -z+ ${INGAMEFX_GFX_TRANS_IN} -z- ${INGAMEFX_GFX_NONTRANS_IN} -b+ -t:29,1,1 -l:$(REPORT_DIR)/ingamefx.lbm -o:$(INGAMEFX_GFX_TEX_OUT) -k:$(INGAMEFX_GFX_REP_FILE)
@$(MV) -f $(INGAMEFX_GFX_OUT_DIR)/ingamefx.h $(INGAMEFX_GFX_HDR_FILE)
GRAF_DIRS_TO_MAKE += $(INGAMEFX_GFX_OUT_DIR)
GFX_DATA_OUT += $(INGAMEFX_GFX_TEX_OUT)
#----------------------------------------------------------------------------
# Front end graphics
#----------------------------------------------------------------------------
FRONTEND_GFX_DIR := $(GRAF_DIR)/frontend
FRONTEND_GFX_OUT_DIR := $(DATA_OUT)/frontend
FRONTEND_GFX_NONTRANS := sky.bmp
FRONTEND_GFX_NONTRANS_IN := $(foreach FILE,$(FRONTEND_GFX_NONTRANS),$(FRONTEND_GFX_DIR)/$(FILE))
FRONTEND_GFX_TRANS := +bg1.bmp
FRONTEND_GFX_TRANS_IN := $(foreach FILE,$(FRONTEND_GFX_TRANS),$(FRONTEND_GFX_DIR)/$(FILE))
FRONTEND_GFX_TRANS_NO_ROT := +island.bmp +sblogo.bmp
FRONTEND_GFX_TRANS_NO_ROT_IN := $(foreach FILE,$(FRONTEND_GFX_TRANS_NO_ROT),$(FRONTEND_GFX_DIR)/$(FILE))
FRONTEND_GFX_TEX_IN := ${FRONTEND_GFX_NONTRANS_IN} ${FRONTEND_GFX_TRANS_IN} ${FRONTEND_GFX_TRANS_NO_ROT_IN}
FRONTEND_GFX_TEX_OUT := $(FRONTEND_GFX_OUT_DIR)/frontend.Spr
FRONTEND_GFX_REP_FILE := $(REPORT_DIR)/frontend.rep
FRONTEND_GFX_HDR_FILE := $(INC_DIR)/frontend.h
cleanfrontend :
$(RM) -f $(FRONTEND_GFX_TEX_OUT)
frontend: $(FRONTEND_GFX_TEX_IN)
$(FRONTEND_GFX_TEX_OUT) : $(FRONTEND_GFX_TEX_IN)
@parkgrab -r- -z+ ${FRONTEND_GFX_TRANS_NO_ROT_IN} -r+ ${FRONTEND_GFX_TRANS_IN} -z- ${FRONTEND_GFX_NONTRANS_IN} -b+ -t:30,1,1 -l:$(REPORT_DIR)/frontend.lbm -o:$(FRONTEND_GFX_TEX_OUT) -k:$(FRONTEND_GFX_REP_FILE)
@$(MV) -f $(FRONTEND_GFX_OUT_DIR)/frontend.h $(FRONTEND_GFX_HDR_FILE)
GRAF_DIRS_TO_MAKE += $(FRONTEND_GFX_OUT_DIR)
GFX_DATA_OUT += $(FRONTEND_GFX_TEX_OUT)
#----------------------------------------------------------------------------
# Big TGA backdrops
#----------------------------------------------------------------------------
BACKDROPS_IN_DIR := $(GRAF_DIR)/backdrop
BACKDROPS_IN := credits sky
BACKDROPS_OUT_DIR := $(DATA_OUT)/backdrop
BACKDROPS_OUT := $(foreach SCREEN,$(BACKDROPS_IN),$(BACKDROPS_OUT_DIR)/$(SCREEN).gfx)
backdrops : $(BACKDROPS_OUT)
cleanbackdrops :
@$(RM) -f $(BACKDROPS_OUT)
$(BACKDROPS_OUT_DIR)/%.gfx : $(BACKDROPS_IN_DIR)/%.tga
alchemy --n -a -15 -^ -o $< $(TEMP_FILE)
chopchop $(TEMP_FILE) $@ 20 262144
GRAF_DIRS_TO_MAKE += $(BACKDROPS_OUT_DIR)
GFX_DATA_OUT += $(BACKDROPS_OUT)
#----------------------------------------------------------------------------
# Sound FX
#----------------------------------------------------------------------------
SFX_IN_DIR := data/SFX
SFX_OUT_DIR := $(DATA_OUT)/SFX
SFX_LIST := ingame
SFX_ALL_IN := $(foreach SFX,$(SFX_LIST),$(SFX_IN_DIR)/$(SFX)/$(SFX).PXM $(SFX_IN_DIR)/$(SFX)/$(SFX).VH $(SFX_IN_DIR)/$(SFX)/$(SFX).VB)
SFX_ALL_OUT := $(foreach SFX,$(SFX_LIST),$(SFX_OUT_DIR)/$(SFX).PXM $(SFX_OUT_DIR)/$(SFX).VH $(SFX_OUT_DIR)/$(SFX).VB)
sfx: $(SFX_ALL_OUT)
cleansfx:
@$(RM) -f $(SFX_ALL_OUT)
$(SFX_ALL_OUT) : $(SFX_ALL_IN)
$(CP) $(SFX_ALL_IN) $(SFX_OUT_DIR)
GRAF_DIRS_TO_MAKE += $(SFX_OUT_DIR)
GFX_DATA_OUT += $(SFX_ALL_OUT)
#----------------------------------------------------------------------------
# Music
#----------------------------------------------------------------------------
MUSIC_IN_DIR := data/music
MUSIC_OUT_DIR := $(DATA_OUT)/music
MUSIC_LIST := hypermmx droppop music
MUSIC_ALL_IN := $(foreach MUSIC,$(MUSIC_LIST),$(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).PXM $(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).VH $(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).VB)
MUSIC_ALL_OUT := $(foreach MUSIC,$(MUSIC_LIST),$(MUSIC_OUT_DIR)/$(MUSIC).PXM $(MUSIC_OUT_DIR)/$(MUSIC).VH $(MUSIC_OUT_DIR)/$(MUSIC).VB)
music: $(MUSIC_ALL_OUT)
cleanmusic:
@$(RM) -f $(MUSIC_ALL_OUT)
$(MUSIC_ALL_OUT) : $(MUSIC_ALL_IN)
$(CP) $(MUSIC_ALL_IN) $(MUSIC_OUT_DIR)
GRAF_DIRS_TO_MAKE += $(MUSIC_OUT_DIR)
GFX_DATA_OUT += $(MUSIC_ALL_OUT)
#----------------------------------------------------------------------------
# Dirs to Make
#----------------------------------------------------------------------------
GRAF_DIRS_TO_MAKE += $(TRANS_OUT_DIR) \
$(UI_GFX_OUT_DIR)
gdirs : $(GRAF_DIRS_TO_MAKE)
$(GRAF_DIRS_TO_MAKE) :
@$(MKDIR) -p $(GRAF_DIRS_TO_MAKE)
@$(ECHO) Created directories $(GRAF_DIRS_TO_MAKE)
#----------------------------------------------------------------------------
# Build the Biflump file
#----------------------------------------------------------------------------
.PHONY: biglump cleanbiglump
BIGLUMP_IN := $(GFX_DATA_OUT)
BIGLUMP_OUT := $(VERSION_DIR)/BigLump.Bin
BIGLUMP_INC := $(INC_DIR)/BigLump.h
biglump : $(BIGLUMP_OUT)
cleanbiglump :
@$(RM) -f $(BIGLUMP_OUT)
@$(GLECHO) Cleaned BigLump
$(BIGLUMP_OUT) : $(BIGLUMP_IN)
$(MAKEDATA) -b:$(OUT_DIR)/Data/ -s:$(GAME_DATA_DIR)/DataCache.Scr -o:$(BIGLUMP_OUT) -i:$(BIGLUMP_INC)
# @$(REDIR) $(TEMP_DIR)/BigLump.Scr $(BIGLUMP_IN)
# $(MAKEDATA) -b:$(OUT_DIR)/Data/ -s:$(GAME_DATA_DIR)/DataCache.Scr -s:$(TEMP_DIR)/BigLump.Scr -o:$(BIGLUMP_OUT) -i:$(BIGLUMP_INC)
# All files MUST be in datacache.scr now :oP
#----------------------------------------------------------------------------
# Where it all happens
#----------------------------------------------------------------------------
# WARNING !!!! BigLump must be the last item that all is dependant on. GRL !!!!
all : dirs gdirs \
biglump
@$(ECHO) Graphics made
#----------------------------------------------------------------------------
# end