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