xref: /f-stack/app/redis-5.0.5/deps/lua/etc/Makefile (revision 572c4311)
1*572c4311Sfengbojiang# makefile for Lua etc
2*572c4311Sfengbojiang
3*572c4311SfengbojiangTOP= ..
4*572c4311SfengbojiangLIB= $(TOP)/src
5*572c4311SfengbojiangINC= $(TOP)/src
6*572c4311SfengbojiangBIN= $(TOP)/src
7*572c4311SfengbojiangSRC= $(TOP)/src
8*572c4311SfengbojiangTST= $(TOP)/test
9*572c4311Sfengbojiang
10*572c4311SfengbojiangCC= gcc
11*572c4311SfengbojiangCFLAGS= -O2 -Wall -I$(INC) $(MYCFLAGS)
12*572c4311SfengbojiangMYCFLAGS=
13*572c4311SfengbojiangMYLDFLAGS= -Wl,-E
14*572c4311SfengbojiangMYLIBS= -lm
15*572c4311Sfengbojiang#MYLIBS= -lm -Wl,-E -ldl -lreadline -lhistory -lncurses
16*572c4311SfengbojiangRM= rm -f
17*572c4311Sfengbojiang
18*572c4311Sfengbojiangdefault:
19*572c4311Sfengbojiang	@echo 'Please choose a target: min noparser one strict clean'
20*572c4311Sfengbojiang
21*572c4311Sfengbojiangmin:	min.c
22*572c4311Sfengbojiang	$(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS)
23*572c4311Sfengbojiang	echo 'print"Hello there!"' | ./a.out
24*572c4311Sfengbojiang
25*572c4311Sfengbojiangnoparser: noparser.o
26*572c4311Sfengbojiang	$(CC) noparser.o $(SRC)/lua.o -L$(LIB) -llua $(MYLIBS)
27*572c4311Sfengbojiang	$(BIN)/luac $(TST)/hello.lua
28*572c4311Sfengbojiang	-./a.out luac.out
29*572c4311Sfengbojiang	-./a.out -e'a=1'
30*572c4311Sfengbojiang
31*572c4311Sfengbojiangone:
32*572c4311Sfengbojiang	$(CC) $(CFLAGS) all.c $(MYLIBS)
33*572c4311Sfengbojiang	./a.out $(TST)/hello.lua
34*572c4311Sfengbojiang
35*572c4311Sfengbojiangstrict:
36*572c4311Sfengbojiang	-$(BIN)/lua -e 'print(a);b=2'
37*572c4311Sfengbojiang	-$(BIN)/lua -lstrict -e 'print(a)'
38*572c4311Sfengbojiang	-$(BIN)/lua -e 'function f() b=2 end f()'
39*572c4311Sfengbojiang	-$(BIN)/lua -lstrict -e 'function f() b=2 end f()'
40*572c4311Sfengbojiang
41*572c4311Sfengbojiangclean:
42*572c4311Sfengbojiang	$(RM) a.out core core.* *.o luac.out
43*572c4311Sfengbojiang
44*572c4311Sfengbojiang.PHONY:	default min noparser one strict clean
45