michael@0: ## -*-makefile-*- michael@0: ## BeOS-specific setup michael@0: ## Copyright (c) 2003-2006, International Business Machines Corporation and michael@0: ## others. All Rights Reserved. michael@0: ## michael@0: ## Original author: Andrew Bachmann michael@0: michael@0: ## Commands to generate dependency files michael@0: GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) michael@0: GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) michael@0: michael@0: # Safe optimizations michael@0: #OPTIMIZATIONS= -fdefault-inline -fdefer-pop -fforce-mem -fforce-addr \ michael@0: # -finline -finline-functions \ michael@0: # -fkeep-inline-functions -fkeep-static-consts -fbranch-count-reg \ michael@0: # -ffunction-cse -fstrength-reduce -fthread-jumps -fcse-follow-jumps \ michael@0: # -fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt \ michael@0: # -fexpensive-optimizations -foptimize-register-move -fregmove \ michael@0: # -fschedule-insns -fschedule-insns2 -ffloat-store -funroll-loops \ michael@0: # -fmove-all-movables -freduce-all-givs -fpeephole \ michael@0: # -funroll-all-loops -ffunction-sections -fdata-sections michael@0: michael@0: # BeOS gccs (geekgadgets + 2.95.3) have this old bug: michael@0: # after this: const wchar_t x[] = L"foo"; michael@0: # x[2] is "optimized" into: (wchar_t)((char *)x)[2] (== 0) michael@0: # michael@0: # see also: http://gcc.gnu.org/ml/gcc-patches/2000-09/msg00454.html michael@0: # michael@0: # Unfortunately this behavior isn't controlled by a flag so we can't michael@0: # use any O optimizations at all. (the behavior kicks in at -O1) michael@0: michael@0: # Optimizations aren't currently defined in the mh files. michael@0: # So Don't override any flags set by the user or runConfigureICU. michael@0: #CFLAGS += $(OPTIMIZATIONS) michael@0: #CXXFLAGS += $(OPTIMIZATIONS) michael@0: michael@0: # Use -nostart instead of -shared michael@0: SHLIB.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -nostart michael@0: SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -nostart michael@0: michael@0: ## Flags for position independent code michael@0: SHAREDLIBCFLAGS = -fPIC michael@0: SHAREDLIBCXXFLAGS = -fPIC michael@0: SHAREDLIBCPPFLAGS = -DPIC michael@0: michael@0: ## Additional flags when building libraries and with threads michael@0: LIBCPPFLAGS = michael@0: THREADSCPPFLAGS = michael@0: michael@0: ## Compiler switch to embed a runtime search path michael@0: LD_RPATH= michael@0: LD_RPATH_PRE = -Wl,-rpath, michael@0: michael@0: ## Compiler switch to embed a library name michael@0: LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) michael@0: michael@0: ## Shared object suffix michael@0: SO = so michael@0: ## Non-shared intermediate object suffix michael@0: STATIC_O = ao michael@0: michael@0: ## Compilation rules michael@0: %.$(STATIC_O): $(srcdir)/%.c michael@0: $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.c michael@0: $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< michael@0: michael@0: %.$(STATIC_O): $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< michael@0: michael@0: michael@0: ## Dependency rules michael@0: %.d: $(srcdir)/%.c michael@0: @echo "generating dependency information for $<" michael@0: @$(SHELL) -ec '$(GEN_DEPS.c) $< \ michael@0: | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ michael@0: [ -s $@ ] || rm -f $@' michael@0: michael@0: %.d: $(srcdir)/%.cpp michael@0: @echo "generating dependency information for $<" michael@0: @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ michael@0: | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ michael@0: [ -s $@ ] || rm -f $@' michael@0: michael@0: ## Versioned libraries rules michael@0: michael@0: %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) michael@0: $(RM) $@ && ln -s ${