summaryrefslogtreecommitdiff
path: root/src/makefiles/Makefile.openbsd
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefiles/Makefile.openbsd')
-rw-r--r--src/makefiles/Makefile.openbsd16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd
new file mode 100644
index 0000000000..14ebbfecf3
--- /dev/null
+++ b/src/makefiles/Makefile.openbsd
@@ -0,0 +1,16 @@
+ifdef ELF_SYSTEM
+LDFLAGS += -Wl,-E
+endif
+%.so: %.o
+ifdef ELF_SYSTEM
+ $(LD) -x -Bshareable -o $@ $<
+else
+ $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
+ @echo building shared object $@
+ @rm -f $@.pic
+ @${AR} cq $@.pic `lorder $<.obj | tsort`
+ ${RANLIB} $@.pic
+ @rm -f $@
+ $(LD) -x -Bshareable -Bforcearchive \
+ -o $@ $@.pic
+endif