diff options
author | Haru <haru@dotalux.com> | 2016-03-31 14:42:56 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-04-16 03:51:38 +0200 |
commit | ab42483e0450fb9a9bd904a8b50df559e099a773 (patch) | |
tree | 1f97999cb3821483d197524e90342bd0b42305b4 | |
parent | c0178d2595e3c0ae2655b9ce2bd5e1ec46d81552 (diff) | |
download | hercules-ab42483e0450fb9a9bd904a8b50df559e099a773.tar.gz hercules-ab42483e0450fb9a9bd904a8b50df559e099a773.tar.bz2 hercules-ab42483e0450fb9a9bd904a8b50df559e099a773.tar.xz hercules-ab42483e0450fb9a9bd904a8b50df559e099a773.zip |
Updated GNU Make build system to support private headers
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r-- | src/char/Makefile.in | 21 | ||||
-rw-r--r-- | src/common/Makefile.in | 31 | ||||
-rw-r--r-- | src/login/Makefile.in | 21 | ||||
-rw-r--r-- | src/map/Makefile.in | 21 | ||||
-rw-r--r-- | src/plugins/Makefile.in | 3 | ||||
-rw-r--r-- | src/test/Makefile.in | 4 | ||||
-rw-r--r-- | src/tool/Makefile.in | 4 |
7 files changed, 59 insertions, 46 deletions
diff --git a/src/char/Makefile.in b/src/char/Makefile.in index 8d9094f18..456f7e9d2 100644 --- a/src/char/Makefile.in +++ b/src/char/Makefile.in @@ -1,7 +1,7 @@ # This file is part of Hercules. # http://herc.ws - http://github.com/HerculesWS/Hercules # -# Copyright (C) 2012-2015 Hercules Dev Team +# Copyright (C) 2012-2016 Hercules Dev Team # Copyright (C) Athena Dev Teams # # Hercules is free software: you can redistribute it and/or modify @@ -23,7 +23,7 @@ CONFIG_D = ../config CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common -COMMON_H = $(wildcard $(COMMON_D)/*.h) +COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h)) SYSINFO_INC = $(COMMON_D)/sysinfo.inc COMMON_INCLUDE = -I.. @@ -47,6 +47,7 @@ CHAR_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(CHAR_C))) CHAR_H = char.h HPMchar.h loginif.h mapif.h geoip.h inter.h int_auction.h int_elemental.h int_guild.h \ int_homun.h int_mail.h int_mercenary.h int_party.h int_pet.h \ int_quest.h int_storage.h pincode.h +CHAR_PH = HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) @@ -89,7 +90,7 @@ help: Makefile: Makefile.in @$(MAKE) -C ../.. src/char/Makefile -$(SYSINFO_INC): $(CHAR_C) $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) +$(SYSINFO_INC): $(CHAR_C) $(CHAR_PH) $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) @echo " MAKE $@" @$(MAKE) -C ../.. sysinfo @@ -112,12 +113,6 @@ char-server: ../../char-server@EXEEXT@ @$(CC) @STATIC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ -# char object files - -obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql - @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< - # missing object files $(COMMON_D)/obj_all/common.a: @echo " MAKE $@" @@ -134,3 +129,11 @@ $(MT19937AR_OBJ): $(LIBCONFIG_OBJ): @echo " MAKE $@" @$(MAKE) -C $(LIBCONFIG_D) + +.SECONDEXPANSION: + +# char object files + +obj_sql/%.o: %.c $$(filter %.p.h, $(CHAR_PH)) $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql + @echo " CC $<" + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 9d4b2d044..4580f70b8 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -1,7 +1,7 @@ # This file is part of Hercules. # http://herc.ws - http://github.com/HerculesWS/Hercules # -# Copyright (C) 2012-2015 Hercules Dev Team +# Copyright (C) 2012-2016 Hercules Dev Team # Copyright (C) Athena Dev Teams # # Hercules is free software: you can redistribute it and/or modify @@ -51,6 +51,7 @@ COMMON_H = atomic.h cbasetypes.h conf.h console.h core.h db.h des.h ers.h \ grfio.h hercules.h HPM.h HPMi.h memmgr.h mapindex.h md5calc.h \ mmo.h mutex.h nullpo.h random.h showmsg.h socket.h spinlock.h \ sql.h strlib.h sysinfo.h thread.h timer.h utils.h winapi.h +COMMON_PH = COMMON_SQL_OBJ = obj_sql/sql.o COMMON_SQL_H = sql.h @@ -95,7 +96,7 @@ help: Makefile: Makefile.in @$(MAKE) -C ../.. src/common/Makefile -$(SYSINFO_INC): $(COMMON_C) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) +$(SYSINFO_INC): $(COMMON_C) $(COMMON_PH) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) @echo " MAKE $@" @$(MAKE) -C ../.. sysinfo @@ -131,25 +132,27 @@ common_mini: $(COMMON_MINI_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common common_sql: $(COMMON_SQL_OBJ) obj_sql/common_sql.a Makefile -obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) $(SYSINFO_INC) | obj_all +# missing object files +$(MT19937AR_OBJ): + @echo " MAKE $@" + @$(MAKE) -C $(MT19937AR_D) + +$(LIBCONFIG_OBJ): + @echo " MAKE $@" + @$(MAKE) -C $(LIBCONFIG_D) + +.SECONDEXPANSION: + +obj_all/sysinfo.o: sysinfo.c $(filter sysinfo.p.h, $(COMMON_PH)) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) $(SYSINFO_INC) | obj_all obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all @echo " CC $<" @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all +obj_all/mini%.o: %.c $$(filter %.p.h, $(COMMON_PH)) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all @echo " CC $<" @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql +obj_sql/%.o: %.c $$(filter %.p.h, $(COMMON_PH)) $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql @echo " CC $<" @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< - -# missing object files -$(MT19937AR_OBJ): - @echo " MAKE $@" - @$(MAKE) -C $(MT19937AR_D) - -$(LIBCONFIG_OBJ): - @echo " MAKE $@" - @$(MAKE) -C $(LIBCONFIG_D) diff --git a/src/login/Makefile.in b/src/login/Makefile.in index 6560e6497..8e10be6d8 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -1,7 +1,7 @@ # This file is part of Hercules. # http://herc.ws - http://github.com/HerculesWS/Hercules # -# Copyright (C) 2012-2015 Hercules Dev Team +# Copyright (C) 2012-2016 Hercules Dev Team # Copyright (C) Athena Dev Teams # # Hercules is free software: you can redistribute it and/or modify @@ -23,7 +23,7 @@ CONFIG_D = ../config CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common -COMMON_H = $(wildcard $(COMMON_D)/*.h) +COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h)) SYSINFO_INC = $(COMMON_D)/sysinfo.inc COMMON_INCLUDE = -I.. @@ -43,6 +43,7 @@ MT19937AR_H = $(MT19937AR_D)/mt19937ar.h LOGIN_C = account_sql.c HPMlogin.c ipban_sql.c login.c loginlog_sql.c LOGIN_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(LOGIN_C))) LOGIN_H = login.h account.h HPMlogin.h ipban.h loginlog.h +LOGIN_PH = HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) @@ -85,7 +86,7 @@ help: Makefile: Makefile.in @$(MAKE) -C ../.. src/login/Makefile -$(SYSINFO_INC): $(LOGIN_C) $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) +$(SYSINFO_INC): $(LOGIN_C) $(LOGIN_PH) $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) @echo " MAKE $@" @$(MAKE) -C ../.. sysinfo @@ -108,12 +109,6 @@ login-server: ../../login-server@EXEEXT@ @$(CC) @STATIC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ -# login object files - -obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql - @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< - # missing object files $(COMMON_D)/obj_all/common.a: @echo " MAKE $@" @@ -130,3 +125,11 @@ $(MT19937AR_OBJ): $(LIBCONFIG_OBJ): @echo " MAKE $@" @$(MAKE) -C $(LIBCONFIG_D) + +.SECONDEXPANSION: + +# login object files + +obj_sql/%.o: %.c $$(filter %.p.h, $(LOGIN_PH)) $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql + @echo " CC $<" + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< diff --git a/src/map/Makefile.in b/src/map/Makefile.in index b5a3d4461..ff582d2f9 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -1,7 +1,7 @@ # This file is part of Hercules. # http://herc.ws - http://github.com/HerculesWS/Hercules # -# Copyright (C) 2012-2015 Hercules Dev Team +# Copyright (C) 2012-2016 Hercules Dev Team # Copyright (C) Athena Dev Teams # # Hercules is free software: you can redistribute it and/or modify @@ -23,7 +23,7 @@ CONFIG_D = ../config CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common -COMMON_H = $(wildcard $(COMMON_D)/*.h) +COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h)) SYSINFO_INC = $(COMMON_D)/sysinfo.inc COMMON_INCLUDE = -I.. @@ -53,6 +53,7 @@ MAP_H = atcommand.h battle.h battleground.h buyingstore.h channel.h chat.h \ mercenary.h mob.h npc.h packets.h packets_struct.h party.h path.h \ pc.h pc_groups.h pet.h quest.h script.h searchstore.h skill.h \ status.h storage.h trade.h unit.h vending.h +MAP_PH = HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) @@ -95,7 +96,7 @@ help: Makefile: Makefile.in @$(MAKE) -C ../.. src/map/Makefile -$(SYSINFO_INC): $(MAP_C) $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) +$(SYSINFO_INC): $(MAP_C) $(MAP_PH) $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) @echo " MAKE $@" @$(MAKE) -C ../.. sysinfo @@ -118,12 +119,6 @@ map-server: ../../map-server@EXEEXT@ @$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ -# map object files - -obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql - @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< - # missing object files $(COMMON_D)/obj_all/common.a: @echo " MAKE $@" @@ -140,3 +135,11 @@ $(MT19937AR_OBJ): $(LIBCONFIG_OBJ): @echo " MAKE $@" @$(MAKE) -C $(LIBCONFIG_D) + +.SECONDEXPANSION: + +# map object files + +obj_sql/%.o: %.c $$(filter %.p.h, $(MAP_PH)) $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql + @echo " CC $<" + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index 3fe38b6bc..c3baa2f30 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -1,7 +1,7 @@ # This file is part of Hercules. # http://herc.ws - http://github.com/HerculesWS/Hercules # -# Copyright (C) 2013-2015 Hercules Dev Team +# Copyright (C) 2013-2016 Hercules Dev Team # # Hercules is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,6 +46,7 @@ ALLPLUGINS = $(filter-out HPMHooking, $(basename $(wildcard *.c))) $(HPMHOOKING) PLUGINS = sample db2sql HPMHooking_char HPMHooking_login HPMHooking_map $(MYPLUGINS) COMMON_D = ../common +# Includes private headers (plugins might need them) COMMON_H = $(wildcard $(COMMON_D)/*.h) COMMON_INCLUDE = -I.. diff --git a/src/test/Makefile.in b/src/test/Makefile.in index 6d2187733..c8006e5cf 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -1,7 +1,7 @@ # This file is part of Hercules. # http://herc.ws - http://github.com/HerculesWS/Hercules # -# Copyright (C) 2012-2015 Hercules Dev Team +# Copyright (C) 2012-2016 Hercules Dev Team # Copyright (C) Athena Dev Teams # # Hercules is free software: you can redistribute it and/or modify @@ -23,7 +23,7 @@ CONFIG_D = ../config CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common -COMMON_H = $(wildcard $(COMMON_D)/*.h) +COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h)) SYSINFO_INC = $(COMMON_D)/sysinfo.inc COMMON_INCLUDE = -I.. diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in index 614ede4b7..eb1362780 100644 --- a/src/tool/Makefile.in +++ b/src/tool/Makefile.in @@ -1,7 +1,7 @@ # This file is part of Hercules. # http://herc.ws - http://github.com/HerculesWS/Hercules # -# Copyright (C) 2012-2015 Hercules Dev Team +# Copyright (C) 2012-2016 Hercules Dev Team # Copyright (C) Athena Dev Teams # # Hercules is free software: you can redistribute it and/or modify @@ -23,7 +23,7 @@ CONFIG_D = ../config CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common -COMMON_H = $(wildcard $(COMMON_D)/*.h) +COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h)) SYSINFO_INC = $(COMMON_D)/sysinfo.inc COMMON_INCLUDE = -I.. |