f7a2025047
OK, here are the final bits for Darwin. This changes the install name of the dylibs and the filename for the 'middle' link. With this set up I have the following link structure in the lib directory: 528 -rw-r--r-- 1 bungi unknown 267748 Jan 31 00:55 libicule.20.0.dylib 8 lrwxrwxr-x 1 bungi unknown 19 Jan 31 00:55 libicule.20.dylib@ -> libicule.20.0.dylib 8 lrwxrwxr-x 1 bungi unknown 19 Jan 31 00:55 libicule.dylib@ -> libicule.20.0.dylib Thus, if you do '-licule' you'll get the most current major/minor version. If you do '-licule.20' you'll get the most current minor version for major version 20. X-SVN-Rev: 7545
77 lines
2.5 KiB
Makefile
77 lines
2.5 KiB
Makefile
## -*-makefile-*-
|
|
## Darwin-specific setup (Darwin is the Mac OS X developer preview, successor
|
|
## to Rhapsody, aka Mac OS X Server)
|
|
## Copyright (c) 1999-2002, International Business Machines Corporation and
|
|
## others. All Rights Reserved.
|
|
##
|
|
## $Id: mh-darwin,v 1.22 2002/01/31 17:03:18 yves-oss Exp $
|
|
|
|
## Flags for position independent code
|
|
SHAREDLIBCFLAGS = -dynamic
|
|
SHAREDLIBCXXFLAGS = -dynamic
|
|
SHAREDLIBCPPFLAGS =
|
|
|
|
## Commands to generate dependency files
|
|
GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
|
|
GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
|
|
|
|
## Commands to compile
|
|
COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c
|
|
COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -fno-common -c
|
|
|
|
## Commands to make a shared library
|
|
SHLIB.c= $(CC) -dynamiclib -dynamic $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -install_name $(DESTDIR)$(libdir)/$(MIDDLE_SO_TARGET)
|
|
SHLIB.cc= $(CXX) -dynamiclib -dynamic $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -install_name $(DESTDIR)$(libdir)/$(MIDDLE_SO_TARGET)
|
|
|
|
## Compiler switch to embed a runtime search path
|
|
LD_RPATH=
|
|
LD_RPATH_PRE=
|
|
|
|
## Environment variable to set a runtime search path
|
|
LDLIBRARYPATH_ENVVAR = DYLD_LIBRARY_PATH
|
|
|
|
## Shared object suffix
|
|
SO= dylib
|
|
## Non-shared intermediate object suffix
|
|
STATIC_O = ao
|
|
|
|
## Versioned target for a shared library.
|
|
FINAL_SO_TARGET = $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
|
|
MIDDLE_SO_TARGET = $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
|
|
|
|
## Compilation rules
|
|
%.$(STATIC_O): $(srcdir)/%.c
|
|
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
|
|
%.o: $(srcdir)/%.c
|
|
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
|
|
|
|
%.$(STATIC_O): $(srcdir)/%.cpp
|
|
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
|
|
%.o: $(srcdir)/%.cpp
|
|
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
|
|
|
|
../data/%.o: ../data/%.c
|
|
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
|
|
|
|
## Dependency rules
|
|
%.d : $(srcdir)/%.c
|
|
@echo "generating dependency information for $<"
|
|
@$(SHELL) -ec '$(GEN_DEPS.c) $< \
|
|
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
|
|
[ -s $@ ] || rm -f $@'
|
|
|
|
%.d : $(srcdir)/%.cpp
|
|
@echo "generating dependency information for $<"
|
|
@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
|
|
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
|
|
[ -s $@ ] || rm -f $@'
|
|
|
|
## Versioned libraries rules
|
|
|
|
%.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
|
|
$(RM) $@ && ln -s ${<F} $@
|
|
%.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
|
|
$(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
|
|
|
|
## End Darwin-specific setup
|