openbsd-ports/devel/luaposix/patches/patch-Makefile
jolan 44d69250d1 compile and link with -fPIC for shared objs
naddy tested, pedro approved
2005-01-10 20:17:07 +00:00

40 lines
789 B
Plaintext

$OpenBSD: patch-Makefile,v 1.2 2005/01/10 20:17:07 jolan Exp $
--- Makefile.orig Wed Nov 5 18:26:49 2003
+++ Makefile Mon Jan 10 12:45:02 2005
@@ -7,29 +7,23 @@ LUALIB= $(LUA)/lib
LUABIN= $(LUA)/bin
# no need to change anything below here
-CFLAGS= -fPIC $(INCS) $(WARN) -O2 $G
-WARN= -pedantic -Wall
-INCS= -I$(LUAINC)
-
+CFLAGS+= -I$(LOCALBASE)/include -fPIC -DPIC
MYNAME= posix
-MYLIB= l$(MYNAME)
+MYLIB= lua$(MYNAME)
-OBJS= $(MYLIB).o
+OBJS= l$(MYNAME).o
T= $(MYLIB).so
-all: test
+all: $T
-test: $T
- $(LUABIN)/lua -l$(MYNAME) test.lua
-
$T: $(OBJS)
- $(CC) -o $@ -shared $(OBJS)
+ $(CC) -o $@ -shared -fPIC $(OBJS)
$(OBJS): modemuncher.c
tree: $T
- $(LUABIN)/lua -l$(MYNAME) tree.lua .
+ lua -l$(MYNAME) tree.lua .
clean:
rm -f $(OBJS) $T core core.* a.out