2011-03-03 21:08:20 +00:00
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
SETTINGSGEN = !!SETTINGSGEN!!
SRC_DIR = !!SRC_DIR!!
CXX_BUILD = !!CXX_BUILD!!
CFLAGS_BUILD = !!CFLAGS_BUILD!!
2012-07-01 08:56:57 +00:00
CXXFLAGS_BUILD = !!CXXFLAGS_BUILD!!
2011-03-03 21:08:20 +00:00
LDFLAGS_BUILD = !!LDFLAGS_BUILD!!
STAGE = !!STAGE!!
SETTING_OBJS_DIR = !!SETTING_OBJS_DIR!!
# Check if we want to show what we are doing
i f d e f V E R B O S E
Q =
E = @true
e l s e
Q = @
E = @echo
e n d i f
all : table /settings .h
2014-04-24 18:09:10 +00:00
settingsgen.o : $( SRC_DIR ) /settingsgen /settingsgen .cpp $( SRC_DIR ) /string_func .h $( SRC_DIR ) /strings_type .h $( SRC_DIR ) /misc /getoptdata .h $( SRC_DIR ) /ini_type .h $( SRC_DIR ) /core /smallvec_type .hpp $( SRC_DIR ) /safeguards .h
2011-03-03 21:08:20 +00:00
$( E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
2012-07-01 08:56:57 +00:00
$( Q) $( CXX_BUILD) $( CFLAGS_BUILD) $( CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
2011-03-03 21:08:20 +00:00
2018-04-29 17:01:28 +00:00
alloc_func.o : $( SRC_DIR ) /core /alloc_func .cpp $( SRC_DIR ) /safeguards .h
2011-03-03 21:08:20 +00:00
$( E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
2012-07-01 08:56:57 +00:00
$( Q) $( CXX_BUILD) $( CFLAGS_BUILD) $( CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
2011-03-03 21:08:20 +00:00
2014-04-24 18:09:10 +00:00
getoptdata.o : $( SRC_DIR ) /misc /getoptdata .cpp $( SRC_DIR ) /misc /getoptdata .h $( SRC_DIR ) /safeguards .h
2011-03-03 21:08:20 +00:00
$( E) '$(STAGE) Compiling $(<:$(SRC_DIR)/misc/%.cpp=%.cpp)'
2012-07-01 08:56:57 +00:00
$( Q) $( CXX_BUILD) $( CFLAGS_BUILD) $( CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
2011-03-03 21:08:20 +00:00
2018-04-29 17:01:28 +00:00
string.o : $( SRC_DIR ) /string .cpp $( SRC_DIR ) /safeguards .h
2011-03-03 21:43:24 +00:00
$( E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
2012-07-01 08:56:57 +00:00
$( Q) $( CXX_BUILD) $( CFLAGS_BUILD) $( CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
2011-03-03 21:43:24 +00:00
2014-04-24 18:09:10 +00:00
ini_load.o : $( SRC_DIR ) /ini_load .cpp $( SRC_DIR ) /core /alloc_func .hpp $( SRC_DIR ) /core /mem_func .hpp $( SRC_DIR ) /ini_type .h $( SRC_DIR ) /string_func .h $( SRC_DIR ) /safeguards .h
2011-03-04 00:27:17 +00:00
$( E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
2012-07-01 08:56:57 +00:00
$( Q) $( CXX_BUILD) $( CFLAGS_BUILD) $( CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
2011-03-03 21:08:20 +00:00
2011-03-04 00:27:17 +00:00
$(SETTINGSGEN) : alloc_func .o string .o ini_load .o settingsgen .o getoptdata .o
2011-03-03 21:08:20 +00:00
$( E) '$(STAGE) Compiling and Linking $@'
2012-07-01 08:56:57 +00:00
$( Q) $( CXX_BUILD) $( CFLAGS_BUILD) $( CXXFLAGS_BUILD) $( LDFLAGS_BUILD) $^ -o $@
2011-03-03 21:08:20 +00:00
table/settings.h : $( SETTINGSGEN ) $( SRC_DIR ) /table /settings .h .preamble $( SRC_DIR ) /table /settings .h .postamble $( SRC_DIR ) /table /*.ini
$( E) '$(STAGE) Generating $@'
@mkdir -p table
$( Q) ./$( SETTINGSGEN) -o table/settings.h -b $( SRC_DIR) /table/settings.h.preamble -a $( SRC_DIR) /table/settings.h.postamble $( SRC_DIR) /table/*.ini
depend :
clean :
$( E) '$(STAGE) Cleaning up settings files'
2018-12-27 21:34:00 +00:00
$( Q) rm -f settingsgen.o alloc_func.o getoptdata.o string.o ini_load.o $( SETTINGSGEN) table/settings.h
2011-03-03 21:08:20 +00:00
mrproper : clean
.PHONY : all mrproper depend clean