xref: /aosp_15_r20/external/e2fsprogs/lib/Makefile.bsd-lib (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Worker#
2*6a54128fSAndroid Build Coastguard Worker# This is a Makefile stub which handles the creation of 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	@echo "	MKDIR pic"
17*6a54128fSAndroid Build Coastguard Worker	@mkdir -p pic
18*6a54128fSAndroid Build Coastguard Worker
19*6a54128fSAndroid Build Coastguard WorkerBSD_LIB = $(BSDLIB_IMAGE).so.$(BSDLIB_VERSION)
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	(cd pic; ld -Bshareable -o $(BSD_LIB) $(LDFLAGS_SHLIB) $(OBJS))
26*6a54128fSAndroid Build Coastguard Worker	$(MV) pic/$(BSD_LIB) .
27*6a54128fSAndroid Build Coastguard Worker	$(RM) -f ../$(BSD_LIB)
28*6a54128fSAndroid Build Coastguard Worker	(cd ..; $(LN) $(LINK_BUILD_FLAGS) \
29*6a54128fSAndroid Build Coastguard Worker		`echo $(my_dir) | sed -e 's;lib/;;'`/$(BSD_LIB) $(BSD_LIB))
30*6a54128fSAndroid Build Coastguard Worker
31*6a54128fSAndroid Build Coastguard Workerinstall-shlibs install:: $(BSD_LIB)
32*6a54128fSAndroid Build Coastguard Worker	@echo "	INSTALL_PROGRAM $(BSDLIB_INSTALL_DIR)/$(BSD_LIB)"
33*6a54128fSAndroid Build Coastguard Worker	@$(INSTALL_PROGRAM) $(BSD_LIB) \
34*6a54128fSAndroid Build Coastguard Worker		$(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB)
35*6a54128fSAndroid Build Coastguard Worker	@-$(LDCONFIG)
36*6a54128fSAndroid Build Coastguard Worker
37*6a54128fSAndroid Build Coastguard Workerinstall-strip: install
38*6a54128fSAndroid Build Coastguard Worker
39*6a54128fSAndroid Build Coastguard Workerinstall-shlibs-strip:: install-shlibs
40*6a54128fSAndroid Build Coastguard Worker
41*6a54128fSAndroid Build Coastguard Workeruninstall-shlibs uninstall::
42*6a54128fSAndroid Build Coastguard Worker	$(RM) -f $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB)
43*6a54128fSAndroid Build Coastguard Worker
44*6a54128fSAndroid Build Coastguard Workerclean::
45*6a54128fSAndroid Build Coastguard Worker	$(RM) -rf pic
46*6a54128fSAndroid Build Coastguard Worker	$(RM) -f $(BSD_LIB)
47*6a54128fSAndroid Build Coastguard Worker	$(RM) -f ../$(BSD_LIB)
48