summaryrefslogtreecommitdiff
path: root/libgcc/config/i386/t-nwld
blob: 408587273da6405956feb06eeffb5010043b0d0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Build a shared libgcc library for NetWare.

SHLIB_EXT = .nlm
SHLIB_NAME = @shlib_base_name@.nlm
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_DEF = $(gcc_srcdir)/config/i386/netware-libgcc.def
SHLIB_MAP = $(gcc_srcdir)/config/i386/netware-libgcc.exp
SHLIB_SRC = $(gcc_srcdir)/config/i386/netware-libgcc.c

SHLIB_LINK = set -e; \
	cat $(SHLIB_DEF) >@shlib_base_name@.def; \
	echo "name $(SHLIB_NAME)" >>@shlib_base_name@.def; \
	echo "version $(version)" | sed "s!\.!,!g" >>@shlib_base_name@.def; \
	touch build; \
	echo "build $$(expr $$(<build) + 0)" >>@shlib_base_name@.def; \
	echo "export @$(SHLIB_MAP)" >>@shlib_base_name@.def; \
	if mpkxdc -n -p @shlib_base_name@.xdc; \
		then echo "xdcdata @shlib_base_name@.xdc" >>@shlib_base_name@.def; \
		else echo "WARNING: $(SHLIB_NAME) built without XDC data will not work well." 1>&2; \
	fi; \
	$(CC) $(LIBGCC2_CFLAGS) -o $(SHLIB_NAME) \
		$(SHLIB_SRC) -posix -static-libgcc -lnetware \
		-Wl,--Map,--map-info,full,--strip-all,--def-file,@shlib_base_name@.def; \
	rm -f @shlib_base_name@.imp; $(LN_S) $(SHLIB_MAP) @shlib_base_name@.imp; \
	rm -f libgcc.imp; $(LN_S) @shlib_base_name@.imp libgcc.imp; \
	expr $$(<build) + 1 >build

SHLIB_INSTALL = \
	$(SHELL) $(srcdir)/mkinstalldirs $(slibdir)$(SHLIB_SLIBDIR_QUAL); \
	$(INSTALL_DATA) $(SHLIB_NAME) $(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_NAME); \
	$(INSTALL_DATA) @shlib_base_name@.imp $(DESTDIR)$(libsubdir)/