Whamcloud - gitweb
Merge branch 'maint' into next
[tools/e2fsprogs.git] / lib / Makefile.darwin-lib
1 #
2 # This is a Makefile stub which handles the creation of Darwin BSD shared
3 # libraries.
4 #
5 # In order to use this stub, the following makefile variables must be defined.
6 #
7 # BSDLIB_VERSION = 1.0
8 # BSDLIB_IMAGE = libce
9 # BSDLIB_MYDIR = et
10 # BSDLIB_INSTALL_DIR = $(SHLIBDIR)
11 #
12
13 all:: image
14
15 real-subdirs:: Makefile
16         $(E) "  MKDIR pic"
17         $(Q) mkdir -p pic
18
19 BSD_LIB = $(BSDLIB_IMAGE).$(BSDLIB_VERSION).dylib
20 BSDLIB_PIC_FLAG = -fPIC
21
22 image:          $(BSD_LIB)
23
24 $(BSD_LIB): $(OBJS)
25         $(E) "  GEN_BSD_SOLIB $(BSD_LIB)"
26         $(Q) (cd pic; $(CC) -dynamiclib -compatibility_version 1.0 -current_version $(BSDLIB_VERSION) \
27                 -install_name $(BSDLIB_INSTALL_DIR)/$(BSD_LIB) \
28                 -undefined dynamic_lookup -o $(BSD_LIB) $(OBJS))
29         $(Q) $(MV) pic/$(BSD_LIB) .
30         $(Q) $(RM) -f ../$(BSD_LIB)
31         $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
32                 `echo $(my_dir) | sed -e 's;lib/;;'`/$(BSD_LIB) $(BSD_LIB))
33         $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(BSD_LIB) $(BSDLIB_IMAGE).dylib)
34
35 install-shlibs install:: $(BSD_LIB)
36         $(E) "  INSTALL_PROGRAM $(BSDLIB_INSTALL_DIR)/$(BSD_LIB)"
37         $(Q) $(INSTALL_PROGRAM) $(BSD_LIB) \
38                 $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB)
39         -$(Q) $(LDCONFIG)
40
41 install-strip: install
42
43 install-shlibs-strip:: install-shlibs
44
45 uninstall-shlibs uninstall::
46         $(RM) -f $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB)
47
48 clean::
49         $(RM) -rf pic
50         $(RM) -f $(BSD_LIB)
51         $(RM) -f ../$(BSD_LIB)
52         $(RM) -f ../$(BSDLIB_IMAGE).dylib