# makefile for poslib 1.4

# set this to suit your setup
LUALIB= /l/lua
LUAINC= /l/lua
LUASRC= /l/lua

# not need to change anything below here
L=$(LUASRC)/lua.c

CC= gcc
#CFLAGS= -g -Wall -ansi -pedantic -Wmissing-prototypes -D_POSIX_SOURCE -I$(LUAINC) 
CFLAGS= -O2 -Wall -ansi -pedantic -D_POSIX_SOURCE -I$(LUAINC) 

OBJS= lua.o lposlib.o

T= plua

all: test

$T:	$(OBJS)
	$(CC) -o $@ $(OBJS) -L$(LUALIB) -llualib -llua -lm

test:	$T
	$T pt.lua

lua.c:	$L
	sed '/add your libraries here/s/$$/ lua_poslibopen(L);/' < $L >$@

clean:
	rm -f $(OBJS) $T lua.c core a.out
