## -*-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.23 2002/05/29 16:45:06 grhoten-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 $(CFLAGS) $(LDFLAGS) -install_name $(DESTDIR)$(libdir)/$(MIDDLE_SO_TARGET) SHLIB.cc= $(CXX) -dynamiclib -dynamic $(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 ${