ICU-400.37.tar.gz
[apple/icu.git] / icuSources / config / mh-hpux-gcc
CommitLineData
b75a7d8f
A
1## -*-makefile-*-
2## HPUX/gcc specific setup
374ca955 3## Copyright (c) 1999-2004, International Business Machines Corporation and
b75a7d8f 4## others. All Rights Reserved.
b75a7d8f
A
5
6## Commands to generate dependency files
7GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
8GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
9
10## Flags for position independent code
11SHAREDLIBCFLAGS = -fPIC
12SHAREDLIBCXXFLAGS = -fPIC
13SHAREDLIBCPPFLAGS = -DPIC
14
15## Common 'default' path to ensure the sanity of users. Search the current
16## directory, at least.
17LD_DEFAULTPATH= -Wl,+b,.:'$$'ORIGIN/
18
19# Get some handy functions defined properly
20DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L
21
22## Commands to link
23## For aCC, use the C++ linker so that __shlinit gets defined
24LINK.c= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
25LINK.cc= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
26
27## Commands to make a shared library
28SHLIB.c= $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH)
29SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH)
30
31## Compiler switch to embed a runtime search path
32LD_RPATH= -Wl,+b,
33LD_RPATH_PRE=
34
35## Compiler switch to embed a library name
374ca955 36LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
b75a7d8f
A
37
38## Environment variable to set a runtime search path
39LDLIBRARYPATH_ENVVAR = SHLIB_PATH
40
41## Shared object suffix
42SO= sl
43## Non-shared intermediate object suffix
44STATIC_O = o
45
46## Compilation rules
47%.$(STATIC_O): $(srcdir)/%.c
48 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
49%.o: $(srcdir)/%.c
50 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
51
52%.$(STATIC_O): $(srcdir)/%.cpp
53 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
54%.o: $(srcdir)/%.cpp
55 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
56
b75a7d8f
A
57
58## Dependency rules
59%.d : $(srcdir)/%.c
60 @echo "Generating dependency information for $<"
61 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
62 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
63 [ -s $@ ] || rm -f $@'
64
65%.d : $(srcdir)/%.cpp
66 @echo "Generating dependency information for $<"
67 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
68 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
69 [ -s $@ ] || rm -f $@'
70
71## Versioned libraries rules
72
73%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
374ca955 74 $(RM) $@ && ln -s ${<F} $@
b75a7d8f 75%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
374ca955 76 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
b75a7d8f
A
77
78## End HPUX/gcc specific setup
79