* Propose using $(STDCPPLIBS) definition for version-independent linking

of standard C++ libraries (stdc++.r4 <-> stdc++ supc++);
* Force C++ language at preprocessing the sources before localization catkeys
  collecting. It gives a hint for compiler to handle .pre file as C++ one 
  preventing breaking on "unfound" C++ headers. Thanks to Vitaly Diger for 
  pointing it out.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42926 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Siarzhuk Zharski
2011-10-26 20:12:09 +00:00
parent bbcc2a8c03
commit 9de720a4ac
2 changed files with 12 additions and 5 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
## BeOS Generic Makefile v2.4 ##
## BeOS Generic Makefile v2.5 ##
## Fill in this file to specify the project being created, and the referenced
## makefile-engine will do all of the hard work for you. This handles both
@@ -56,6 +56,9 @@ RSRCS=
# libXXX.so or libXXX.a you can simply specify XXX
# library: libbe.so entry: be
#
# - for version-independent linking of standard C++ libraries please add
# $(STDCPPLIBS) instead of raw "stdc++[.r4] [supc++]" library names
#
# - for localization support add following libs:
# locale localestub
#
+8 -4
View File
@@ -1,8 +1,8 @@
## BeOS and Haiku Generic Makefile Engine v2.4.0
## BeOS and Haiku Generic Makefile Engine v2.5.0
## Does all the hard work for the Generic Makefile
## which simply defines the project parameters
## Supports Generic Makefile v2.0, 2.01, 2.1, 2.2, 2.3, 2.4
## Supports Generic Makefile v2.0, 2.01, 2.1, 2.2, 2.3, 2.4, 2.5
# determine wheather running on x86 or ppc
MACHINE=$(shell uname -m)
@@ -142,17 +142,21 @@ SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file))))
VPATH :=
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
# SETTING: build the local and system include paths
# SETTING: build the local and system include paths, compose C++ libs
ifeq ($(CPU), x86)
LOC_INCLUDES = $(foreach path, $(SRC_PATHS) $(LOCAL_INCLUDE_PATHS), $(addprefix -I, $(path)))
ifeq ($(CC_VER), 2)
INCLUDES = $(LOC_INCLUDES)
INCLUDES += -I-
INCLUDES += $(foreach path, $(SYSTEM_INCLUDE_PATHS), $(addprefix -I, $(path)))
STDCPPLIBS = stdc++.r4
else
INCLUDES = -iquote./
INCLUDES += $(foreach path, $(SRC_PATHS) $(LOCAL_INCLUDE_PATHS), $(addprefix -iquote, $(path)))
INCLUDES += $(foreach path, $(SYSTEM_INCLUDE_PATHS), $(addprefix -isystem, $(path)))
STDCPPLIBS = stdc++ supc++
endif
else
ifeq ($(CPU), ppc)
@@ -310,7 +314,7 @@ $(CATALOGS_DIR)/%.catalog : $(CATKEYS_DIR)/%.catkeys
# rule to preprocess program sources into file ready for collecting catkeys
$(OBJ_DIR)/$(NAME).pre : $(SRCS)
-cat $(SRCS) | $(CC) -E $(INCLUDES) $(CFLAGS) -DB_COLLECTING_CATKEYS - > $(OBJ_DIR)/$(NAME).pre
-cat $(SRCS) | $(CC) -E -x c++ $(INCLUDES) $(CFLAGS) -DB_COLLECTING_CATKEYS - > $(OBJ_DIR)/$(NAME).pre
# rules to collect localization catkeys
catkeys : $(CATKEYS_DIR)/en.catkeys