61 lines
1.5 KiB
Text
61 lines
1.5 KiB
Text
|
|
||
|
COPT = -O2
|
||
|
# COPT = -DLPEG_DEBUG -g
|
||
|
|
||
|
CWARNS = -Wall -Wextra -pedantic \
|
||
|
-Waggregate-return \
|
||
|
-Wcast-align \
|
||
|
-Wcast-qual \
|
||
|
-Wdisabled-optimization \
|
||
|
-Wpointer-arith \
|
||
|
-Wshadow \
|
||
|
-Wsign-compare \
|
||
|
-Wundef \
|
||
|
-Wwrite-strings \
|
||
|
-Wbad-function-cast \
|
||
|
-Wdeclaration-after-statement \
|
||
|
-Wmissing-prototypes \
|
||
|
-Wnested-externs \
|
||
|
-Wstrict-prototypes \
|
||
|
# -Wunreachable-code \
|
||
|
|
||
|
|
||
|
CFLAGS = $(CWARNS) -nostdinc -B ../../05/tcc-bootstrap -I ../../05/musl-bootstrap/include -I$(LUADIR)
|
||
|
CC = ../../05/tcc-0.9.27/tcc
|
||
|
|
||
|
FILES = lplvm.o lplcap.o lpltree.o lplcode.o lplprint.o
|
||
|
# For Linux
|
||
|
linux:
|
||
|
make lpeglabel.so "DLLFLAGS = -shared -nostdlib -B ../../05/tcc-bootstrap "
|
||
|
|
||
|
# For Mac OS
|
||
|
# macosx:
|
||
|
# make lpeglabel.so "DLLFLAGS = -bundle -undefined dynamic_lookup"
|
||
|
|
||
|
# For Windows
|
||
|
# windows:
|
||
|
# make lpeglabel.dll "DLLFLAGS = -shared -fPIC"
|
||
|
|
||
|
lpeglabel.so: $(FILES)
|
||
|
$(CC) $(DLLFLAGS) $(FILES) -o lpeglabel.so ../lua-bootstrap/lib/liblua.a ../../05/musl-bootstrap/lib/libc.a
|
||
|
lpeglabel.dll: $(FILES)
|
||
|
$(CC) $(DLLFLAGS) $(FILES) -o lpeglabel.dll $(LUADIR)/bin/lua53.dll
|
||
|
|
||
|
$(FILES): makefile
|
||
|
|
||
|
test: test.lua testlabel.lua testrelabelparser.lua relabel.lua lpeglabel.so
|
||
|
lua test.lua
|
||
|
lua testlabel.lua
|
||
|
lua testrelabelparser.lua
|
||
|
|
||
|
clean:
|
||
|
rm -f $(FILES) lpeglabel.so
|
||
|
|
||
|
|
||
|
lplcap.o: lplcap.c lplcap.h lpltypes.h
|
||
|
lplcode.o: lplcode.c lpltypes.h lplcode.h lpltree.h lplvm.h lplcap.h
|
||
|
lplprint.o: lplprint.c lpltypes.h lplprint.h lpltree.h lplvm.h lplcap.h
|
||
|
lpltree.o: lpltree.c lpltypes.h lplcap.h lplcode.h lpltree.h lplvm.h lplprint.h
|
||
|
lplvm.o: lplvm.c lplcap.h lpltypes.h lplvm.h lplprint.h lpltree.h
|
||
|
|