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