From 50398b7a03d2fac86c5206603fb4c0443d8d4e58 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Mon, 1 Aug 2005 10:58:28 +0000 Subject: [PATCH] define common build flags so they can easily be changed for all tools svn path=/trunk/; revision=16941 --- reactos/tools/bin2c.mak | 4 ++-- reactos/tools/bin2res/bin2res.mak | 4 ++-- reactos/tools/buildno/buildno.mak | 12 ++++++------ reactos/tools/cabman/cabman.mak | 14 +++++++------- reactos/tools/cdmake/cdmake.c | 3 +++ reactos/tools/cdmake/cdmake.mak | 4 ++-- reactos/tools/gendib/gendib.mak | 4 ++-- reactos/tools/mkhive/mkhive.mak | 4 ++-- reactos/tools/nci/nci.mak | 4 ++-- reactos/tools/rbuild/rbuild.mak | 4 ++-- reactos/tools/rsym.mak | 4 ++-- reactos/tools/tools.mak | 4 ++++ reactos/tools/unicode/unicode.mak | 3 ++- reactos/tools/widl/widl.mak | 4 ++-- reactos/tools/winebuild/winebuild.mak | 4 ++-- reactos/tools/wmc/wmc.mak | 20 ++++++++++---------- reactos/tools/wpp/wpp.mak | 2 +- reactos/tools/wrc/wrc.mak | 4 ++-- 18 files changed, 55 insertions(+), 47 deletions(-) diff --git a/reactos/tools/bin2c.mak b/reactos/tools/bin2c.mak index b47869b0af0..d3a59933ae1 100644 --- a/reactos/tools/bin2c.mak +++ b/reactos/tools/bin2c.mak @@ -15,9 +15,9 @@ BIN2C_SOURCES = \ BIN2C_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(BIN2C_SOURCES:.c=.o)) -BIN2C_HOST_CFLAGS = -g -Werror -Wall +BIN2C_HOST_CFLAGS = $(TOOLS_CFLAGS) -BIN2C_HOST_LFLAGS = -g +BIN2C_HOST_LFLAGS = $(TOOLS_LFLAGS) .PHONY: bin2c bin2c: $(BIN2C_TARGET) diff --git a/reactos/tools/bin2res/bin2res.mak b/reactos/tools/bin2res/bin2res.mak index 3d9dad21eab..9c21091e06c 100644 --- a/reactos/tools/bin2res/bin2res.mak +++ b/reactos/tools/bin2res/bin2res.mak @@ -26,9 +26,9 @@ BIN2RES_SOURCES = $(addprefix $(BIN2RES_BASE_), \ BIN2RES_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(BIN2RES_SOURCES:.c=.o)) -BIN2RES_HOST_CFLAGS = -Iinclude/wine -D__REACTOS__ -g -Werror -Wall +BIN2RES_HOST_CFLAGS = -Iinclude/wine -D__REACTOS__ $(TOOLS_CFLAGS) -BIN2RES_HOST_LFLAGS = -g +BIN2RES_HOST_LFLAGS = $(TOOLS_LFLAGS) $(BIN2RES_TARGET): $(BIN2RES_OBJECTS) | $(BIN2RES_OUT) $(ECHO_LD) diff --git a/reactos/tools/buildno/buildno.mak b/reactos/tools/buildno/buildno.mak index 1e4c36b80c4..78e740a1a5d 100644 --- a/reactos/tools/buildno/buildno.mak +++ b/reactos/tools/buildno/buildno.mak @@ -28,9 +28,9 @@ BUILDNO_SOURCES = $(addprefix $(BUILDNO_BASE_), \ BUILDNO_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(BUILDNO_SOURCES:.cpp=.o)) -BUILDNO_HOST_CFLAGS = -Iinclude/reactos -g -Werror -Wall +BUILDNO_HOST_CXXFLAGS = -Iinclude/reactos $(TOOLS_CPPFLAGS) -BUILDNO_HOST_LFLAGS = -g +BUILDNO_HOST_LFLAGS = $(TOOLS_LFLAGS) $(BUILDNO_TARGET): $(BUILDNO_OBJECTS) | $(BUILDNO_OUT) $(ECHO_LD) @@ -38,19 +38,19 @@ $(BUILDNO_TARGET): $(BUILDNO_OBJECTS) | $(BUILDNO_OUT) $(BUILDNO_INT_)buildno.o: $(BUILDNO_BASE_)buildno.cpp | $(BUILDNO_INT) $(ECHO_CC) - ${host_gpp} $(BUILDNO_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(BUILDNO_HOST_CXXFLAGS) -c $< -o $@ $(BUILDNO_INT_)exception.o: $(BUILDNO_BASE_)exception.cpp | $(BUILDNO_INT) $(ECHO_CC) - ${host_gpp} $(BUILDNO_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(BUILDNO_HOST_CXXFLAGS) -c $< -o $@ $(BUILDNO_INT_)ssprintf.o: $(BUILDNO_BASE_)ssprintf.cpp | $(BUILDNO_INT) $(ECHO_CC) - ${host_gpp} $(BUILDNO_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(BUILDNO_HOST_CXXFLAGS) -c $< -o $@ $(BUILDNO_INT_)XML.o: $(BUILDNO_BASE_)XML.cpp | $(BUILDNO_INT) $(ECHO_CC) - ${host_gpp} $(BUILDNO_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(BUILDNO_HOST_CXXFLAGS) -c $< -o $@ .PHONY: buildno_clean buildno_clean: diff --git a/reactos/tools/cabman/cabman.mak b/reactos/tools/cabman/cabman.mak index 240a9108210..3fb72b9a0d6 100755 --- a/reactos/tools/cabman/cabman.mak +++ b/reactos/tools/cabman/cabman.mak @@ -29,11 +29,11 @@ CABMAN_SOURCES = $(addprefix $(CABMAN_BASE_), \ CABMAN_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(CABMAN_SOURCES:.cxx=.o)) -CABMAN_HOST_CFLAGS = -Iinclude/reactos -Ilib/zlib -g -Werror -Wall +CABMAN_HOST_CXXFLAGS = -Iinclude/reactos -Ilib/zlib $(TOOLS_CXXFLAGS) CABMAN_HOST_LIBS = $(ZLIB_HOST_TARGET) -CABMAN_HOST_LFLAGS = -g $(CABMAN_HOST_LIBS) +CABMAN_HOST_LFLAGS = $(TOOLS_LFLAGS) $(CABMAN_HOST_LIBS) .PHONY: cabman cabman: $(CABMAN_TARGET) @@ -44,23 +44,23 @@ $(CABMAN_TARGET): $(CABMAN_OBJECTS) $(CABMAN_HOST_LIBS) | $(CABMAN_OUT) $(CABMAN_INT_)cabinet.o: $(CABMAN_BASE_)cabinet.cxx | $(CABMAN_INT) $(ECHO_CC) - ${host_gpp} $(CABMAN_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(CABMAN_HOST_CXXFLAGS) -c $< -o $@ $(CABMAN_INT_)dfp.o: $(CABMAN_BASE_)dfp.cxx | $(CABMAN_INT) $(ECHO_CC) - ${host_gpp} $(CABMAN_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(CABMAN_HOST_CXXFLAGS) -c $< -o $@ $(CABMAN_INT_)main.o: $(CABMAN_BASE_)main.cxx | $(CABMAN_INT) $(ECHO_CC) - ${host_gpp} $(CABMAN_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(CABMAN_HOST_CXXFLAGS) -c $< -o $@ $(CABMAN_INT_)mszip.o: $(CABMAN_BASE_)mszip.cxx | $(CABMAN_INT) $(ECHO_CC) - ${host_gpp} $(CABMAN_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(CABMAN_HOST_CXXFLAGS) -c $< -o $@ $(CABMAN_INT_)raw.o: $(CABMAN_BASE_)raw.cxx | $(CABMAN_INT) $(ECHO_CC) - ${host_gpp} $(CABMAN_HOST_CFLAGS) -c $< -o $@ + ${host_gpp} $(CABMAN_HOST_CXXFLAGS) -c $< -o $@ .PHONY: cabman_clean cabman_clean: diff --git a/reactos/tools/cdmake/cdmake.c b/reactos/tools/cdmake/cdmake.c index 483d616585d..5ed51d61d88 100644 --- a/reactos/tools/cdmake/cdmake.c +++ b/reactos/tools/cdmake/cdmake.c @@ -423,6 +423,9 @@ write_directory_record(PDIR_RECORD d, if (d->extension_on_cd[0] != 0) identifier_size += 1 + strlen(d->extension_on_cd); break; + default: + identifier_size = 1; + break; } } record_size = 33 + identifier_size; diff --git a/reactos/tools/cdmake/cdmake.mak b/reactos/tools/cdmake/cdmake.mak index 7f5131ecab0..085b814fb4f 100644 --- a/reactos/tools/cdmake/cdmake.mak +++ b/reactos/tools/cdmake/cdmake.mak @@ -26,9 +26,9 @@ CDMAKE_SOURCES = $(addprefix $(CDMAKE_BASE_), \ CDMAKE_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(CDMAKE_SOURCES:.c=.o)) -CDMAKE_HOST_CFLAGS = -Iinclude -g -Werror -Wall +CDMAKE_HOST_CFLAGS = -Iinclude $(TOOLS_CFLAGS) -CDMAKE_HOST_LFLAGS = -g +CDMAKE_HOST_LFLAGS = $(TOOLS_LFLAGS) .PHONY: cdmake cdmake: $(CDMAKE_TARGET) diff --git a/reactos/tools/gendib/gendib.mak b/reactos/tools/gendib/gendib.mak index 4bd1af55b3c..b0a044f9db7 100644 --- a/reactos/tools/gendib/gendib.mak +++ b/reactos/tools/gendib/gendib.mak @@ -24,9 +24,9 @@ GENDIB_SOURCES = \ GENDIB_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(GENDIB_SOURCES:.c=.o)) -GENDIB_HOST_CFLAGS = -g -Werror -Wall +GENDIB_HOST_CFLAGS = $(TOOLS_CFLAGS) -GENDIB_HOST_LFLAGS = -g +GENDIB_HOST_LFLAGS = $(TOOLS_LFLAGS) $(GENDIB_TARGET): $(GENDIB_OBJECTS) | $(GENDIB_OUT) $(ECHO_LD) diff --git a/reactos/tools/mkhive/mkhive.mak b/reactos/tools/mkhive/mkhive.mak index 5354d59c27d..6f1e2252640 100644 --- a/reactos/tools/mkhive/mkhive.mak +++ b/reactos/tools/mkhive/mkhive.mak @@ -29,9 +29,9 @@ MKHIVE_SOURCES = $(addprefix $(MKHIVE_BASE_), \ MKHIVE_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(MKHIVE_SOURCES:.c=.o)) -MKHIVE_HOST_CFLAGS = -g -Werror -Wall +MKHIVE_HOST_CFLAGS = $(TOOLS_CFLAGS) -MKHIVE_HOST_LFLAGS = -g +MKHIVE_HOST_LFLAGS = $(TOOLS_LFLAGS) .PHONY: mkhive mkhive: $(MKHIVE_TARGET) diff --git a/reactos/tools/nci/nci.mak b/reactos/tools/nci/nci.mak index 26e1ae62194..f0d14a034b9 100644 --- a/reactos/tools/nci/nci.mak +++ b/reactos/tools/nci/nci.mak @@ -24,9 +24,9 @@ NCI_SOURCES = \ NCI_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(NCI_SOURCES:.c=.o)) -NCI_HOST_CFLAGS = -Iinclude -g -Werror -Wall +NCI_HOST_CFLAGS = -Iinclude $(TOOLS_CFLAGS) -NCI_HOST_LFLAGS = -g +NCI_HOST_LFLAGS = $(TOOLS_LFLAGS) $(NCI_TARGET): $(NCI_OBJECTS) | $(NCI_OUT) $(ECHO_LD) diff --git a/reactos/tools/rbuild/rbuild.mak b/reactos/tools/rbuild/rbuild.mak index 61a0684942b..e7a5c2b8646 100644 --- a/reactos/tools/rbuild/rbuild.mak +++ b/reactos/tools/rbuild/rbuild.mak @@ -215,9 +215,9 @@ RBUILD_TEST_OBJECTS = \ $(RBUILD_COMMON_OBJECTS) \ $(RBUILD_TEST_SPECIAL_OBJECTS) -RBUILD_HOST_CXXFLAGS = -g -I$(RBUILD_BASE) -Werror -Wall +RBUILD_HOST_CXXFLAGS = -I$(RBUILD_BASE) $(TOOLS_CPPFLAGS) -RBUILD_HOST_LFLAGS = -g +RBUILD_HOST_LFLAGS = $(TOOLS_LFLAGS) .PHONY: rbuild rbuild: $(RBUILD_TARGET) diff --git a/reactos/tools/rsym.mak b/reactos/tools/rsym.mak index 2dc03f92a7d..ad6b383de87 100644 --- a/reactos/tools/rsym.mak +++ b/reactos/tools/rsym.mak @@ -16,9 +16,9 @@ RSYM_SOURCES = \ RSYM_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(RSYM_SOURCES:.c=.o)) -RSYM_HOST_CFLAGS = -g -Werror -Wall +RSYM_HOST_CFLAGS = $(TOOLS_CFLAGS) -RSYM_HOST_LFLAGS = -g +RSYM_HOST_LFLAGS = $(TOOLS_LFLAGS) .PHONY: rsym rsym: $(RSYM_TARGET) diff --git a/reactos/tools/tools.mak b/reactos/tools/tools.mak index feb8eeca29d..15150d28cb7 100644 --- a/reactos/tools/tools.mak +++ b/reactos/tools/tools.mak @@ -5,6 +5,10 @@ TOOLS_INT_ = $(TOOLS_INT)$(SEP) TOOLS_OUT = $(OUTPUT_)$(TOOLS_BASE) TOOLS_OUT_ = $(TOOLS_OUT)$(SEP) +TOOLS_CFLAGS = -Werror -Wall -Wpointer-arith -Wno-strict-aliasing +TOOLS_CPPFLAGS = -Werror -Wall -Wpointer-arith +TOOLS_LFLAGS = + $(TOOLS_INT): | $(INTERMEDIATE) $(ECHO_MKDIR) ${mkdir} $@ diff --git a/reactos/tools/unicode/unicode.mak b/reactos/tools/unicode/unicode.mak index 5d5334cdc04..0842635915f 100644 --- a/reactos/tools/unicode/unicode.mak +++ b/reactos/tools/unicode/unicode.mak @@ -97,7 +97,8 @@ UNICODE_OBJECTS = \ UNICODE_HOST_CFLAGS = \ -D__USE_W32API -DWINVER=0x501 -DWINE_UNICODE_API= \ -Dwchar_t="unsigned short" -D_WCHAR_T_DEFINED \ - -I$(UNICODE_BASE) -Iinclude/wine -Iw32api/include + -I$(UNICODE_BASE) -Iinclude/wine -Iw32api/include \ + $(TOOLS_CFLAGS) .PHONY: unicode unicode: $(UNICODE_TARGET) diff --git a/reactos/tools/widl/widl.mak b/reactos/tools/widl/widl.mak index d552051036e..7c124731e76 100644 --- a/reactos/tools/widl/widl.mak +++ b/reactos/tools/widl/widl.mak @@ -53,12 +53,12 @@ WIDL_SOURCES = $(addprefix $(WIDL_BASE_), \ WIDL_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(WIDL_SOURCES:.c=.o)) -WIDL_HOST_CFLAGS = -g -Werror -Wall \ +WIDL_HOST_CFLAGS = $(TOOLS_CFLAGS) \ -DINT16=SHORT -D__USE_W32API -DYYDEBUG=1 \ -I$(WIDL_BASE) -I$(WPP_BASE) \ -Iinclude/wine -Iinclude -Iw32api/include -WIDL_HOST_LFLAGS = -g +WIDL_HOST_LFLAGS = $(TOOLS_LFLAGS) WIDL_LIBS = $(WPP_TARGET) diff --git a/reactos/tools/winebuild/winebuild.mak b/reactos/tools/winebuild/winebuild.mak index ca90c91626c..0ba4d9163dc 100644 --- a/reactos/tools/winebuild/winebuild.mak +++ b/reactos/tools/winebuild/winebuild.mak @@ -32,9 +32,9 @@ WINEBUILD_SOURCES = $(addprefix $(WINEBUILD_BASE_), \ WINEBUILD_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(WINEBUILD_SOURCES:.c=.o)) -WINEBUILD_HOST_CFLAGS = -D__USE_W32API -Iinclude/wine +WINEBUILD_HOST_CFLAGS = $(TOOLS_CFLAGS) -D__USE_W32API -Iinclude -Iinclude/wine -WINEBUILD_HOST_LFLAGS = -g +WINEBUILD_HOST_LFLAGS = $(TOOLS_LFLAGS) .PHONY: winebuild winebuild: $(WINEBUILD_TARGET) diff --git a/reactos/tools/wmc/wmc.mak b/reactos/tools/wmc/wmc.mak index c8ad33fa774..63c67d15f04 100644 --- a/reactos/tools/wmc/wmc.mak +++ b/reactos/tools/wmc/wmc.mak @@ -32,9 +32,9 @@ WMC_SOURCES = $(addprefix $(WMC_BASE_), \ WMC_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(WMC_SOURCES:.c=.o)) -WMC_HOST_CXXFLAGS = -I$(WMC_BASE) -g -Werror -Wall +WMC_HOST_CFLAGS = -I$(WMC_BASE) $(TOOLS_CFLAGS) -WMC_HOST_LFLAGS = -g +WMC_HOST_LFLAGS = $(TOOLS_LFLAGS) .PHONY: wmc wmc: $(WMC_TARGET) @@ -45,35 +45,35 @@ $(WMC_TARGET): $(WMC_OBJECTS) | $(WMC_OUT) $(WMC_INT_)getopt.o: $(WMC_BASE_)getopt.c | $(WMC_INT) $(ECHO_CC) - ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@ + ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@ $(WMC_INT_)lang.o: $(WMC_BASE_)lang.c | $(WMC_INT) $(ECHO_CC) - ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@ + ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@ $(WMC_INT_)mcl.o: $(WMC_BASE_)mcl.c | $(WMC_INT) $(ECHO_CC) - ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@ + ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@ $(WMC_INT_)utils.o: $(WMC_BASE_)utils.c | $(WMC_INT) $(ECHO_CC) - ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@ + ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@ $(WMC_INT_)wmc.o: $(WMC_BASE_)wmc.c | $(WMC_INT) $(ECHO_CC) - ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@ + ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@ $(WMC_INT_)write.o: $(WMC_BASE_)write.c | $(WMC_INT) $(ECHO_CC) - ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@ + ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@ $(WMC_INT_)y_tab.o: $(WMC_BASE_)y_tab.c | $(WMC_INT) $(ECHO_CC) - ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@ + ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@ $(WMC_INT_)misc.o: $(WMC_BASE_)misc.c | $(WMC_INT) $(ECHO_CC) - ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@ + ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@ .PHONY: wmc_clean wmc_clean: diff --git a/reactos/tools/wpp/wpp.mak b/reactos/tools/wpp/wpp.mak index 5e271463897..404996d1b64 100644 --- a/reactos/tools/wpp/wpp.mak +++ b/reactos/tools/wpp/wpp.mak @@ -28,7 +28,7 @@ WPP_SOURCES = $(addprefix $(WPP_BASE_), \ WPP_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(WPP_SOURCES:.c=.o)) -WPP_HOST_CFLAGS = -D__USE_W32API -I$(WPP_BASE) -Iinclude -Iinclude/wine -g +WPP_HOST_CFLAGS = -D__USE_W32API -I$(WPP_BASE) -Iinclude -Iinclude/wine $(TOOLS_CFLAGS) .PHONY: wpp wpp: $(WPP_TARGET) diff --git a/reactos/tools/wrc/wrc.mak b/reactos/tools/wrc/wrc.mak index 8a782f861a9..c8ba46bf212 100644 --- a/reactos/tools/wrc/wrc.mak +++ b/reactos/tools/wrc/wrc.mak @@ -52,13 +52,13 @@ WRC_SOURCES = $(addprefix $(WRC_BASE_), \ WRC_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(WRC_SOURCES:.c=.o)) -WRC_HOST_CFLAGS = -I$(WRC_BASE) -g -Werror -Wall \ +WRC_HOST_CFLAGS = -I$(WRC_BASE) $(TOOLS_CFLAGS) \ -D__USE_W32API -DWINE_UNICODE_API= \ -Dwchar_t="unsigned short" -D_WCHAR_T_DEFINED \ -I$(UNICODE_BASE) -I$(WPP_BASE) \ -Iinclude/wine -Iinclude -Iw32api/include -WRC_HOST_LFLAGS = -g +WRC_HOST_LFLAGS = $(TOOLS_LFLAGS) WRC_LIBS = $(UNICODE_TARGET) $(WPP_TARGET)