|
1 ## -*-makefile-*- |
|
2 ## Darwin-specific setup (Darwin is the Mac OS X developer preview, successor |
|
3 ## to Rhapsody, aka Mac OS X Server) |
|
4 ## Copyright (c) 1999-2012 International Business Machines Corporation and |
|
5 ## others. All Rights Reserved. |
|
6 |
|
7 ## Flags for position independent code |
|
8 SHAREDLIBCFLAGS = -dynamic |
|
9 SHAREDLIBCXXFLAGS = -dynamic |
|
10 SHAREDLIBCPPFLAGS = |
|
11 |
|
12 # Do not export internal methods by default |
|
13 LIBCFLAGS += -fvisibility=hidden |
|
14 LIBCXXFLAGS += -fvisibility=hidden |
|
15 |
|
16 # Pad out the paths to the maximum possible length |
|
17 LD_FLAGS += -headerpad_max_install_names |
|
18 |
|
19 # We do not need to see the stderr message that the archive was made. |
|
20 ARFLAGS += -c |
|
21 |
|
22 ## Commands to compile |
|
23 COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c |
|
24 COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -fno-common -c |
|
25 |
|
26 ## Commands to make a shared library |
|
27 SHLIB.c= $(CC) -dynamiclib -dynamic $(CFLAGS) $(LDFLAGS) $(LD_SOOPTIONS) |
|
28 SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS) |
|
29 |
|
30 ## Compiler switches to embed a library name and version information |
|
31 LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name @executable_path/$(notdir $(MIDDLE_SO_TARGET)) |
|
32 |
|
33 ## Compiler switch to embed a runtime search path |
|
34 LD_RPATH= |
|
35 LD_RPATH_PRE= -Wl,-rpath, |
|
36 |
|
37 ## Environment variable to set a runtime search path |
|
38 LDLIBRARYPATH_ENVVAR = DYLD_LIBRARY_PATH |
|
39 |
|
40 GENCCODE_ASSEMBLY=-a gcc-darwin |
|
41 |
|
42 ## Shared object suffix |
|
43 SO= dylib |
|
44 ## Non-shared intermediate object suffix |
|
45 STATIC_O = ao |
|
46 |
|
47 ## Override Versioned target for a shared library. |
|
48 FINAL_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO) |
|
49 MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO) |
|
50 |
|
51 ## Compilation and dependency rules |
|
52 %.$(STATIC_O): $(srcdir)/%.c |
|
53 $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<) |
|
54 %.o: $(srcdir)/%.c |
|
55 $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<) |
|
56 |
|
57 %.$(STATIC_O): $(srcdir)/%.cpp |
|
58 $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<) |
|
59 %.o: $(srcdir)/%.cpp |
|
60 $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<) |
|
61 |
|
62 ## Versioned libraries rules |
|
63 |
|
64 %.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO) |
|
65 $(RM) $@ && ln -s ${<F} $@ |
|
66 %.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO) |
|
67 $(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@ |
|
68 |
|
69 # tzcode option |
|
70 TZORIG_EXTRA_CFLAGS=-DSTD_INSPIRED |
|
71 |
|
72 # genren opts |
|
73 GENREN_PL_OPTS=-x Mach-O -n '-g' -p '| c++filt' |
|
74 |
|
75 ## Remove shared library 's' |
|
76 STATIC_PREFIX_WHEN_USED = |
|
77 STATIC_PREFIX = |
|
78 |
|
79 ## End Darwin-specific setup |