mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 05:28:14 +00:00

- Set the minimum GCC version to 4.4.0 and minimum Binutils version to 20091016. - Remove the -fno-unit-at-a-time hacks. - Remove dgorbachev's temporary hacks for user-mode C++ applications. - Merge ntoskrnl's "precomp.h" and "ntoskrnl.h" again, the PCH issues have been fixed. - Use our "ofmt_stub.a" to be compatible with newer MinGW Runtime versions. - Use LD's new -exclude-all-symbols option to not auto-export all symbols in case no DEF file or __declspec(dllexport) was specified. We used to patch our LD version to work around this problem. - Use LD's --start-group and --end-group parameters to allow a more flexible linking order. - Use GCC's -fno-set-stack-executable for amd64 and i386 targets to disable adding the __enable_execute_stack code. - Change the makefile's name to "makefile-$(ARCH).auto" for all architectures. - Remove some -Wno-error flags. See issue #4810 for more details. svn path=/trunk/; revision=45535
166 lines
4.5 KiB
Makefile
166 lines
4.5 KiB
Makefile
CFLAG_WERROR:=-Werror
|
|
CFLAG_CRTDLL:=-D_DLL -D__USE_CRTIMP
|
|
|
|
CXXFLAG_WERROR:=-Werror
|
|
CXXFLAG_CRTDLL:=-D_DLL -D__USE_CRTIMP
|
|
|
|
CPPFLAG_WERROR:=-Werror
|
|
CPPFLAG_UNICODE:=-DUNICODE -D_UNICODE
|
|
|
|
# FIXME: disabled until RosBE stops sucking
|
|
# BUILTIN_CPPFLAGS+= -nostdinc
|
|
BUILTIN_CFLAGS+= -fno-optimize-sibling-calls
|
|
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
|
|
|
|
$(5): $(2) $(3) | ${call RBUILD_dir,$(5)}
|
|
$$(ECHO_DEPENDS)
|
|
$${gcc} -xc -MF $$@ $(4) -M -MP -MT $$@ $$<
|
|
|
|
endef
|
|
|
|
#(module, source, dependencies, cflags, output)
|
|
define RBUILD_CXX_DEPENDS
|
|
|
|
$(5): $(2) $(3) | ${call RBUILD_dir,$(5)}
|
|
$$(ECHO_DEPENDS)
|
|
$${gpp} -MF $$@ $(4) -M -MP -MT $$@ $$<
|
|
|
|
endef
|
|
|
|
#(source, cflags)
|
|
RBUILD_PIPE_CPP=$${gcc} $(2) -xc -E $(1)
|
|
RBUILD_PIPE_CXX_CPP=$${gpp} $(2) -E $(1)
|
|
|
|
#(module, source, dependencies, cflags, output)
|
|
define RBUILD_CPP
|
|
|
|
$(5): $(2) $(3) | ${call RBUILD_dir,$(5)}
|
|
$$(ECHO_CPP)
|
|
${call RBUILD_PIPE_CPP,$$<,$(4)} > $$@
|
|
|
|
endef
|
|
|
|
#(module, source, dependencies, cflags, output)
|
|
define RBUILD_CXX_CPP
|
|
|
|
$(5): $(2) $(3) | ${call RBUILD_dir,$(5)}
|
|
$$(ECHO_CPP)
|
|
${call RBUILD_PIPE_CXX_CPP,$$<,$(4)} > $$@
|
|
|
|
endef
|
|
|
|
#(module, source, dependencies, cflags, output)
|
|
define RBUILD_CC
|
|
|
|
$(2): $${$(1)_precondition}
|
|
|
|
ifeq ($(ROS_BUILDDEPS),full)
|
|
|
|
${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_cflags,$(1),$(4)},$(5).d}
|
|
-include $(5).d
|
|
|
|
$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)}
|
|
$$(ECHO_CC)
|
|
$${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -c $$<
|
|
|
|
else
|
|
|
|
$(5): $(2) $(3) | ${call RBUILD_dir,$(5)}
|
|
$$(ECHO_CC)
|
|
$${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -c $$<
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
#(module, source, dependencies, cflags, output)
|
|
define RBUILD_CXX
|
|
|
|
$(2): $${$(1)_precondition}
|
|
|
|
ifeq ($(ROS_BUILDDEPS),full)
|
|
|
|
${call RBUILD_CXX_DEPENDS,$(1),$(2),,${call RBUILD_cxxflags,$(1),$(4)},$(5).d}
|
|
-include $(5).d
|
|
|
|
$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)}
|
|
$$(ECHO_CC)
|
|
$${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$<
|
|
|
|
else
|
|
|
|
$(5): $(2) $(3) | ${call RBUILD_dir,$(5)}
|
|
$$(ECHO_CC)
|
|
$${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$<
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
#(module, source, dependencies, cflags)
|
|
RBUILD_CC_RULE=${call RBUILD_CC,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o}
|
|
RBUILD_CXX_RULE=${call RBUILD_CXX,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o}
|
|
|
|
#(module, source, dependencies, cflags)
|
|
define RBUILD_CC_PCH_RULE
|
|
|
|
$(2): $${$(1)_precondition}
|
|
|
|
ifeq ($$(ROS_BUILDDEPS),full)
|
|
|
|
${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d: $(2) | ${call RBUILD_intermediate_dir,$(2)}
|
|
$$(ECHO_DEPENDS)
|
|
$${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$<
|
|
|
|
-include $$(intermediate_dir)$$(SEP).gch_$$(module_name)$$(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 $$@ $$<
|
|
|
|
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} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header $$<
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
#(module, source, dependencies, cflags)
|
|
define RBUILD_CXX_PCH_RULE
|
|
|
|
$(2): $${$(1)_precondition}
|
|
|
|
ifeq ($$(ROS_BUILDDEPS),full)
|
|
|
|
${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d: $(2) | ${call RBUILD_intermediate_dir,$(2)}
|
|
$$(ECHO_DEPENDS)
|
|
$${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$<
|
|
|
|
-include $$(intermediate_dir)$$(SEP).gch_$$(module_name)$$(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 $$@ $$<
|
|
|
|
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} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header $$<
|
|
|
|
endif
|
|
|
|
endef
|
|
|