From 32e1ebaa367bc9df4e19ee0634dd054ae298ae06 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 14 May 2015 08:53:50 +0800 Subject: integrate luajit build process into makefile --- Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 659774c..9fd8873 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,21 @@ -.PHONY: all clean +.PHONY: all clean luajit OBJS := oop_example.o nerv.o luaT.o -INCLUDE := -I luajit-2.0/build/include/luajit-2.0/ -DLUA_USE_APICHECK -LDFLAGS := -L luajit-2.0/build/lib/ -llua -lm +LIBS := libnerv.so +INCLUDE := -I build/luaJIT/include/luajit-2.0/ -DLUA_USE_APICHECK +#LDFLAGS := -L luajit-2.0/build/lib/ -llua -lm OBJ_DIR := build/objs OBJS := $(addprefix $(OBJ_DIR)/,$(OBJS)) -all: libnerv.so -$(OBJS): $(OBJ_DIR) +LIBS := $(addprefix $(OBJ_DIR)/,$(LIBS)) +all: luajit $(OBJ_DIR) $(LIBS) +luajit: + ./build_luajit.sh $(OBJ_DIR): -mkdir -p $(OBJ_DIR) $(OBJ_DIR)/%.o: %.c gcc -c -o $@ $< $(INCLUDE) -fPIC $(OBJ_DIR)/luaT.o: gcc -c -o $@ luaT/luaT.c $(INCLUDE) -fPIC -libnerv.so: $(OBJS) - gcc -shared -o $(OBJ_DIR)/$@ $(OBJS) +$(LIBS): $(OBJS) + gcc -shared -o $@ $(OBJS) clean: -rm -rf $(OBJ_DIR) -- cgit v1.2.3