aboutsummaryrefslogblamecommitdiffstats
path: root/Game/Code/Makefile.in
blob: 6ab1902e472d7d0bc8953a319125456ac0127ba3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

                                                 
                    










                            
                 













                             
                





                                    
                                    







                                                                      

                                     

                                                                        


                                                                                    
                                                                                          







                                                                
                                               

          

                         



















                                        
 
                                                                                                                                                        
 
                               
 
                              
 





                                                                       

                          
                               








                                                                                                
 








                                
                                             


                                     
                                                     
                                                                                                                                              
 
                   
                               


                                                      
 
                 
 


                                                                                                 
                                                  
                                                           
                                                            


                              

           
                                                                                                               
                          

           
                                 
 
                                                         


                                             
                               

                                                                                            
                                                 








                                    
                                  
##
# Makefile for @PACKAGE_NAME@ @PACKAGE_VERSION@ 
# @configure_input@
##

# general definitions
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
infodir = @infodir@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
datarootdir = @datarootdir@
VPATH = @srcdir@

# install tool
INSTALL = @INSTALL@
# calls "ln -s"
LN_S = @LN_S@

USDX_PREFIX = UltraStar
USDX_TOOLS_DIR = ../../Tools

EXE_SUFFIX = @EXEEXT@

# Free Pascal compiler
PPC = @PPC@
PFLAGS = @PFLAGS@
PLIBS = @PLIBS@
# FPC target platform and processor
PPLATFORM = @FPC_PLATFORM@
PPROCESSOR = @FPC_PROCESSOR@

# lazarus defines
LAZARUS_DIR = @LAZARUS_DIR@
LCL_WIDGET_TYPE = @LCL_WIDGET_TYPE@
PROJ_SUFFIX = .lpr

# RC to LRS resource compiler
RESCOMPILER_NAME = USDXResCompiler
RESCOMPILER_BIN = $(USDX_TOOLS_DIR)/$(RESCOMPILER_NAME)$(EXE_SUFFIX)
RESCOMPILER_SRC = $(USDX_TOOLS_DIR)/$(RESCOMPILER_NAME)$(PROJ_SUFFIX)
RESCOMPILER_PFLAGS = -dRELEASE

# Directories added to the unit path
PUNIT_TOKEN = -Fu
PUNIT_FLAGS = \
    $(PUNIT_TOKEN)$(LAZARUS_DIR)/lcl/units/$(PPROCESSOR)-$(PPLATFORM) \
    $(PUNIT_TOKEN)$(LAZARUS_DIR)/components/images/lib/$(PPROCESSOR)-$(PPLATFORM) \
    $(PUNIT_TOKEN)$(LAZARUS_DIR)/components/jpeg \
    $(PUNIT_TOKEN).
#    $(PUNIT_TOKEN)$(LAZARUS_DIR)/lcl/units/$(PPROCESSOR)-$(PPLATFORM)/$(LCL_WIDGET_TYPE)

# Directory where compiled units (.ppu and .o files) are stored
PCUNIT_TOKEN = -FU
PCUNIT_DIR = ./build/$(PPLATFORM)/lazarus
PCUNIT_FLAGS = $(PCUNIT_TOKEN)$(PCUNIT_DIR)

# Directories added to the includes path
PINC_TOKEN = -Fi
PINC_FLAGS = $(PINC_TOKEN)lib/JEDI-SDL/SDL/Pas

# Defines
PDEFINES  = -dLCL 
#-dLCL$(LCL_WIDGET_TYPE)

# Misc fpc options
PCOMPAT_FLAGS    = -S2dgi
#PCOMPAT_FLAGS  += -Mdelphi
PVERBOSE_FLAGS   = -vew -l
#PDEBUG_FLAGS     = -g -gl
#PDEBUG_FLAGS     = -dDEBUG
#POTHER_FLAGS = -Crtoi
#POPTIMIZE_FLAGS_FPC204 = -OG2p3 
#POPTIMIZE_FLAGS_FPC220 = -O2p"NAME"
#POPTIMIZE_FLAGS = -dRELEASE 
#POPTIMIZE_FLAGS = -Xs
PFLAGS += $(PCOMPAT_FLAGS) \
          $(PVERBOSE_FLAGS) \
	  $(PDEFINES) 

# lpr project file used as input
USDX_SRC = $(USDX_PREFIX)$(PROJ_SUFFIX)
# name of executable
USDX_BIN = $(USDX_PREFIX)$(EXE_SUFFIX)

.PHONY: all resources ultrastardx-app install install-dev install-release uninstall uninstall-dev uninstall-release clean distclean clean_obj clean_res

all: resources ultrastardx-app

resources: $(USDX_PREFIX).lrs

ultrastardx-app: $(USDX_BIN)

# Clean and rebuild everything because FPC caches some old files
# (it uses an .inc-files cache for example).
# As a result FPC misses some changes if it is called without cleaning
# up first (very annoying while debugging).
$(USDX_BIN): clean_obj
#	$(MAKE) clean_obj
	mkdir -p $(PCUNIT_DIR)
	$(PPC) $(PFLAGS) $(PLIBS) $(PINC_FLAGS) $(PUNIT_FLAGS) $(PCUNIT_FLAGS) -o$@ $(USDX_SRC)

install: install-@install_type@
# all

uninstall: uninstall-@install_type@


# local development build

install-dev:
	mv $(USDX_BIN) ../..

uninstall-dev:
	rm -f ../../$(USDX_BIN)

# global release build

install-release:
# TODO: copy files to the appropriate places
#	$()/mkinstalldirs $(bindir)
#	$()/mkinstalldirs $(libdir)
#	$()/mkinstalldirs $(infodir)
#	$(INSTALL) $(USDX_BIN) $(bindir)/$(USDX_BIN)
	@echo '"install-release" does not exist yet. Install USDX yourself or use "./configure --enable-dev-build" for a local installation.'

uninstall-release:
# TODO: remove installed files
#	rm -f xyz
	@echo '"install-release" does not exist yet.'


clean: clean_obj

distclean: clean clean_res
	find . -name "*.o" -o -name "*.ppu" -o -name "*.rst" -o -name "*.compiled" | xargs rm -f
	find . -name "*~" -name "*.bak" -o -name "*.orig" -o -name "*.dcu" | xargs rm -f
	find . -name "__history" | xargs rm -r -f
	rm -f $(USDX_PREFIX).res $(USDX_PREFIX).identcache
	rm -f config.inc config.log config.status configure
	rm -f Makefile
	rm -f aclocal.m4 
	rm -rf autom4te.cache

clean_obj:
	find "$(PCUNIT_DIR)" -name "*.o" -o -name "*.ppu" -o -name "*.rst" -o -name "*.compiled" | xargs rm -f
	rm -f $(USDX_BIN)

clean_res:
	rm -f $(USDX_PREFIX).lrs

$(USDX_PREFIX).lrs: $(RESCOMPILER_BIN) $(USDX_PREFIX).rc
	$(RESCOMPILER_BIN) $(USDX_PREFIX).rc

$(RESCOMPILER_BIN): $(RESCOMPILER_SRC)
	mkdir -p $(PCUNIT_DIR)
	$(PPC) $(RESCOMPILER_PFLAGS) $(PUNIT_FLAGS) $(PCUNIT_FLAGS) -o$@ $(RESCOMPILER_SRC)

configure: configure.ac config.inc.in aclocal.m4
	autoconf

aclocal.m4: m4/*
	aclocal -I m4

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck