16f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## -*-makefile-*-
26f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## HP/UX-specific setup using aCC
36f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Copyright (c) 1999-2012, International Business Machines Corporation and
46f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## others. All Rights Reserved.
56f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
66f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Commands to generate dependency files
76f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgGEN_DEPS.c=	:
86f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgGEN_DEPS.cc= 	:
96f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Flags for position independent code
116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSHAREDLIBCFLAGS = +Z
126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSHAREDLIBCXXFLAGS = +Z
136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Additional flags when building libraries with threads
156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## We use this instead of -mt, which isn't available in all versions of aCC
166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Our tools won't compile with -D_POSIX_C_SOURCE=199506L
176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgTHREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# Use Extended ANSI mode, which is useful for 64-bit numbers
206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# +W ignores some warnings
216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#    740 Unsafe cast between pointers/references to incomplete classes...
226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#    749 This operation is non-portable and potentially unsafe.
236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#        (Ironically the solution to fix this warning is non-portable)
246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#    823 Redundant preprocessing concatenation operation results in two valid
256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#        preprocessing tokens. This comes from INT64_C in <inttypes.h>
266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   4232 conversion to a more strictly aligned type may cause misaligned access.
276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCFLAGS += -Ae +Olit=all
286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCXXFLAGS += -AA -Wc,-ansi_for_scope,on +W740 +W749 +W823 +W4232
296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgifeq ($(UCLN_NO_AUTO_CLEANUP),0)
316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# set up init point.
326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgUCLN_FINI =  ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME)
336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI)
346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLDFLAGS_FINI = -Wl,+fini,$(UCLN_FINI)
356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCPPFLAGSICUUC += $(CPPFLAGS_FINI)
376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLDFLAGSICUUC += $(LDFLAGS_FINI)
386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCPPFLAGSICUIO += $(CPPFLAGS_FINI)
396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLDFLAGSICUIO += $(LDFLAGS_FINI)
406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCPPFLAGSICUI18N += $(CPPFLAGS_FINI)
416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLDFLAGSICUI18N += $(LDFLAGS_FINI)
426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCPPFLAGSCTESTFW += $(CPPFLAGS_FINI)
436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLDFLAGSCTESTFW += $(LDFLAGS_FINI)
446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# ICUUC, ICUIO, ICUI18N, CTESTFW
466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgendif
476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# -Bhidden_def Hides all symbols defined in the module.
496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#LIBCFLAGS = -Bhidden_def
506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#LIBCXXFLAGS = -Bhidden_def
516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Commands to compile
536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCOMPILE.c=	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c
546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgCOMPILE.cc=	$(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c
556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Common 'default' path to ensure the sanity of users.  Search the current
576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## directory, at least.
586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_DEFAULTPATH= -Wl,+b,'$$'ORIGIN/
596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# Use SHLIB_PATH and LD_LIBRARY_PATH to locate shared libraries
616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLDFLAGS += -Wl,+s $(LD_DEFAULTPATH)
626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Commands to link
646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## For aCC, use the C++ linker so that __shlinit gets defined
656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLINK.c=		$(CXX) $(CXXFLAGS) $(LDFLAGS)
666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLINK.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS)
676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Shared library options
696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## HPUX PA-risc does not recognize -Bprotected_def aC++ option.
706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Use linker option -Wl,-B,symbolic instead.
716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgifeq ($(shell uname -m),ia64)
726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_SOOPTIONS= -Bprotected_def
736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgelse
746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_SOOPTIONS= -Wl,-B,symbolic
756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgendif
766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Commands to make a shared library
786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#SHLIB.c=	$(LD) $(LDFLAGS) -b
796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSHLIB.c=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS)
806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSHLIB.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS)
816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Compiler switch to embed a runtime search path
836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_RPATH=	-Wl,+b,
846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_RPATH_PRE= 	
856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Environment variable to set a runtime search path
876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLDLIBRARYPATH_ENVVAR = SHLIB_PATH
886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Compiler switch to embed a library name
906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgLD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## The type of assembly needed when pkgdata is used for generating shared libraries.
936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# Commented out for now because the hp1 test machine runs out of memory.
946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#GENCCODE_ASSEMBLY=-a aCC-parisc
956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Shared object suffix
976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSO=		sl
986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Non-shared intermediate object suffix
996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSTATIC_O = o
1006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Compilation rules
1026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.$(STATIC_O): $(srcdir)/%.c
1036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
1046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.o: $(srcdir)/%.c
1056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
1066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.$(STATIC_O): $(srcdir)/%.cpp
1086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
1096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.o: $(srcdir)/%.cpp
1106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
1116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Dependency rules
1146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.d : $(srcdir)/%.c
1156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	@echo "generating dependency information for $<"
1166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	@$(GEN_DEPS.c) $< > $@
1176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.d : $(srcdir)/%.cpp
1196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	@echo "generating dependency information for $<"
1206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	@$(GEN_DEPS.cc) $< > $@
1216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Versioned libraries rules
1236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
1256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(RM) $@ && ln -s ${<F} $@
1266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
1276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
1286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Install libraries as executable
1306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgINSTALL-L=$(INSTALL_PROGRAM)
1316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## Remove shared library 's'
1336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSTATIC_PREFIX_WHEN_USED = 
1346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSTATIC_PREFIX = 
1356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org## End HP/UX-specific setup
137