2000-12-07 14:43:49 -05:00
|
|
|
AROPT = cr
|
2000-10-21 18:36:14 -04:00
|
|
|
|
2000-03-07 20:58:46 -05:00
|
|
|
ifdef ELF_SYSTEM
|
2000-10-07 14:43:23 -04:00
|
|
|
export_dynamic = -Wl,-E
|
2005-12-09 16:19:36 -05:00
|
|
|
rpath = -Wl,-R'$(rpathdir)'
|
2001-06-20 16:15:45 -04:00
|
|
|
else
|
2005-12-09 16:19:36 -05:00
|
|
|
rpath = -Wl,-R'$(rpathdir)'
|
2000-03-07 20:58:46 -05:00
|
|
|
endif
|
2000-10-21 18:36:14 -04:00
|
|
|
|
|
|
|
|
DLSUFFIX = .so
|
2004-10-11 19:27:23 -04:00
|
|
|
|
|
|
|
|
ifeq ($(findstring sparc,$(host_cpu)), sparc)
|
|
|
|
|
CFLAGS_SL = -fPIC -DPIC
|
|
|
|
|
else
|
2000-10-21 18:36:14 -04:00
|
|
|
CFLAGS_SL = -fpic -DPIC
|
2004-10-11 19:27:23 -04:00
|
|
|
endif
|
|
|
|
|
|
2000-10-21 18:36:14 -04:00
|
|
|
|
2010-07-05 14:54:38 -04:00
|
|
|
# Rule for building a shared library from a single .o file
|
2000-03-07 20:58:46 -05:00
|
|
|
%.so: %.o
|
|
|
|
|
ifdef ELF_SYSTEM
|
2010-07-05 14:54:38 -04:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
|
2000-03-07 20:58:46 -05:00
|
|
|
else
|
|
|
|
|
$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
|
|
|
|
|
@echo building shared object $@
|
|
|
|
|
@rm -f $@.pic
|
2006-04-19 12:32:08 -04:00
|
|
|
@${AR} cq $@.pic $<.obj
|
2000-03-07 20:58:46 -05:00
|
|
|
${RANLIB} $@.pic
|
|
|
|
|
@rm -f $@
|
2004-10-11 19:27:23 -04:00
|
|
|
$(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
|
2000-03-07 20:58:46 -05:00
|
|
|
endif
|