Merge trunk HEAD (r46369)
[reactos.git] / reactos / tools / rbuild / backend / mingw / compilers / gcc.mak
index c8c09bd..1f2a09f 100644 (file)
@@ -9,9 +9,19 @@ CPPFLAG_UNICODE:=-DUNICODE -D_UNICODE
 
 # FIXME: disabled until RosBE stops sucking
 # BUILTIN_CPPFLAGS+= -nostdinc
+ifeq ($(ROS_ARCH),i386)
+BUILTIN_CFLAGS+= -fno-optimize-sibling-calls -fno-set-stack-executable
+else
 BUILTIN_CFLAGS+= -fno-optimize-sibling-calls
+endif
 BUILTIN_CXXFLAGS+= -fno-optimize-sibling-calls
 
+# Add -fno-set-stack-executable required for x86/MinGW
+ifneq (,$(filter $(ARCH),amd64 i386))
+       BUILTIN_CFLAGS+= -fno-set-stack-executable
+       BUILTIN_CXXFLAGS+= -fno-set-stack-executable
+endif
+
 #(module, source, dependencies, cflags, output)
 define RBUILD_DEPENDS
 
@@ -119,13 +129,13 @@ ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d:
 
 ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)
        $$(ECHO_PCH)
-       $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$<
+       $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header $$<
 
 else
 
 ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)
        $$(ECHO_PCH)
-       $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$<
+       $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header $$<
 
 endif
 
@@ -146,15 +156,14 @@ ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d:
 
 ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)
        $$(ECHO_PCH)
-       $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$<
+       $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header $$<
 
 else
 
 ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)
        $$(ECHO_PCH)
-       $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$<
+       $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header $$<
 
 endif
 
 endef
-