summaryrefslogtreecommitdiff
path: root/src/makefiles/Makefile.freebsd
blob: 57afc185249af35594af1fb6561f1a8d34b5f064 (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
AROPT = cr

ifdef ELF_SYSTEM
export_dynamic = -Wl,-export-dynamic
rpath = -Wl,-R'$(rpathdir)'
endif

DLSUFFIX = .so

CFLAGS_SL = -fPIC -DPIC

ifeq ($(findstring i386,$(host_cpu)), i386)
allow_nonpic_in_shlib = yes
endif


%.so: %.o
ifdef ELF_SYSTEM
	$(CC) $(CFLAGS) -shared -o $@ $<
else
	$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
	@echo building shared object $@
	@rm -f [email protected]
	@${AR} cq [email protected] $<.obj
	${RANLIB} [email protected]
	@rm -f $@
	$(LD) -x -Bshareable -Bforcearchive -o $@ [email protected]
endif