blob: c94a5e72195a1f19b89a4e0c152b2b138c80f6bc [file] [log] [blame]
Theodore Ts'oe71d8732003-03-14 02:13:48 -05001#
2# This is a Makefile stub which handles the creation of Darwin BSD shared
3# libraries.
4#
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -05005# In order to use this stub, the following makefile variables must be defined.
Theodore Ts'oe71d8732003-03-14 02:13:48 -05006#
7# BSDLIB_VERSION = 1.0
8# BSDLIB_IMAGE = libce
9# BSDLIB_MYDIR = et
10# BSDLIB_INSTALL_DIR = $(SHLIBDIR)
11#
12
Theodore Ts'o42c0b612008-01-01 16:48:09 -050013all:: image
Theodore Ts'oe71d8732003-03-14 02:13:48 -050014
Theodore Ts'o3f546fc2006-03-10 21:39:40 -050015real-subdirs:: Makefile
Theodore Ts'oc13351f2009-07-02 00:11:17 -040016 $(E) " MKDIR pic"
17 $(Q) mkdir -p pic
Theodore Ts'oe71d8732003-03-14 02:13:48 -050018
19BSD_LIB = $(BSDLIB_IMAGE).$(BSDLIB_VERSION).dylib
Theodore Ts'o434661f2004-02-29 22:46:49 -050020BSDLIB_PIC_FLAG = -fPIC
Theodore Ts'oe71d8732003-03-14 02:13:48 -050021
22image: $(BSD_LIB)
23
24$(BSD_LIB): $(OBJS)
Theodore Ts'oc13351f2009-07-02 00:11:17 -040025 $(E) " GEN_BSD_SOLIB $(BSD_LIB)"
26 $(Q) (cd pic; $(CC) -dynamiclib -compatibility_version 1.0 -current_version $(BSDLIB_VERSION) \
Theodore Ts'oe71d8732003-03-14 02:13:48 -050027 -flat_namespace -undefined warning -o $(BSD_LIB) $(OBJS))
Theodore Ts'oc13351f2009-07-02 00:11:17 -040028 $(Q) $(MV) pic/$(BSD_LIB) .
29 $(Q) $(RM) -f ../$(BSD_LIB)
Theodore Ts'o5aa6c3f2010-05-17 19:21:42 -040030 $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
31 `echo $(my_dir) | sed -e 's;lib/;;'`/$(BSD_LIB) $(BSD_LIB))
32 $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(BSD_LIB) $(BSDLIB_IMAGE).dylib)
Theodore Ts'oe71d8732003-03-14 02:13:48 -050033
34install-shlibs install:: $(BSD_LIB)
Theodore Ts'oc13351f2009-07-02 00:11:17 -040035 $(E) " INSTALL_PROGRAM $(BSDLIB_INSTALL_DIR)/$(BSD_LIB)"
36 $(Q) $(INSTALL_PROGRAM) $(BSD_LIB) \
Theodore Ts'oe71d8732003-03-14 02:13:48 -050037 $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB)
Theodore Ts'oc13351f2009-07-02 00:11:17 -040038 -$(Q) $(LDCONFIG)
Theodore Ts'o522798d2004-12-15 11:28:55 -050039
40install-strip: install
41
42install-shlibs-strip: install-shlibs
Theodore Ts'oe71d8732003-03-14 02:13:48 -050043
44uninstall-shlibs uninstall::
45 $(RM) -f $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB)
46
47clean::
48 $(RM) -rf pic
49 $(RM) -f $(BSD_LIB)
50 $(RM) -f ../$(BSD_LIB)
51 $(RM) -f ../$(BSDLIB_IMAGE).dylib