1## -*-makefile-*- 2## Copyright (C) 2016 and later: Unicode, Inc. and others. 3## License & terms of use: http://www.unicode.org/copyright.html 4## MP-RAS specific setup 5## Copyright (c) 2003-2004, International Business Machines Corporation and 6## others. All Rights Reserved. 7## 8## Original contributer: Jason Gordon from NCR 9 10## Flags for position independent code 11SHAREDLIBCFLAGS = -K PIC 12SHAREDLIBCXXFLAGS = -K PIC 13SHAREDLIBCPPFLAGS = -DPIC 14 15## Commands to generate dependency files 16GEN_DEPS.c= $(CC) -Hnocopyr -I/usr/include -Hcpplvl=3 -Xa -Hmake $(DEFS) $(CPPFLAGS) 17GEN_DEPS.cc= $(CXX) -Hnocopyr -I/usr/include -Hcpplvl=3 -Xa -Hmake $(DEFS) $(CPPFLAGS) 18 19## Commands to link 20LINK.c= $(CC) $(CXXFLAGS) $(LDFLAGS) 21LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) 22 23## Commands to make a shared library 24SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -G 25SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -G 26 27## Compiler switch to embed a runtime search path 28LD_RPATH= -YP, 29LD_RPATH_PRE= 30 31## Compiler switch to embed a library name 32LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) 33 34## Shared object suffix 35SO= so 36## Non-shared intermediate object suffix 37STATIC_O = o 38 39## Compilation rules 40%.$(STATIC_O): $(srcdir)/%.c 41 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< 42%.o: $(srcdir)/%.c 43 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< 44 45%.$(STATIC_O): $(srcdir)/%.cpp 46 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< 47%.o: $(srcdir)/%.cpp 48 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< 49 50 51## Dependency rules 52%.d : $(srcdir)/%.c 53 @echo "generating dependency information for $<" 54 @$(GEN_DEPS.c) $< > $@ 55 56%.d : $(srcdir)/%.cpp 57 @echo "generating dependency information for $<" 58 @$(GEN_DEPS.cc) $< > $@ 59 60## Versioned libraries rules 61 62%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) 63 $(RM) $@ && ln -s ${<F} $@ 64%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) 65 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ 66 67