blob: 84f05b8d4b97c7aba625af5bc126c15a040970a3 [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
13all:: pic image
14
15subdirs:: pic
16
17pic:
18 mkdir pic
19
20BSD_LIB = $(BSDLIB_IMAGE).$(BSDLIB_VERSION).dylib
Theodore Ts'o434661f2004-02-29 22:46:49 -050021BSDLIB_PIC_FLAG = -fPIC
Theodore Ts'oe71d8732003-03-14 02:13:48 -050022
23image: $(BSD_LIB)
24
25$(BSD_LIB): $(OBJS)
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -050026 (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))
28 $(MV) pic/$(BSD_LIB) .
29 $(RM) -f ../$(BSD_LIB)
30 $(LN) $(BSD_LIB) ../$(BSD_LIB)
31 $(LN) ../$(BSD_LIB) ../$(BSDLIB_IMAGE).dylib
32
33install-shlibs install:: $(BSD_LIB)
34 $(INSTALL_PROGRAM) $(BSD_LIB) \
35 $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB)
36 -$(LDCONFIG)
37
38uninstall-shlibs uninstall::
39 $(RM) -f $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB)
40
41clean::
42 $(RM) -rf pic
43 $(RM) -f $(BSD_LIB)
44 $(RM) -f ../$(BSD_LIB)
45 $(RM) -f ../$(BSDLIB_IMAGE).dylib