From 7ad767dab0efa4c7824712fa0b3be0341b24e617 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 15 Sep 2009 15:40:46 +0000 Subject: [PATCH] updated Makefile to handle different environments git-svn-id: svn://anubis/anaglym/trunk@12 99a6e188-d820-4881-8870-2d33a10e2619 --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7543877..703edff 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,18 @@ OBJS := $(COBJS) $(CXXOBJS) CDEPS := $(COBJS:.o=.dep) CXXDEPS := $(CXXOBJS:.o=.dep) DEPS := $(CDEPS) $(CXXDEPS) -CPPFLAGS := -I/usr/include/lua5.1 -LDFLAGS := -llua5.1 -lGL -lGLU + +LUAINCLUDE := $(shell which lua-config >/dev/null 2>&1; if [[ $$? == 0 ]]; then lua-config --include; fi) +ifeq ($(LUA_INCLUDE),) +LUA_INCLUDE := -I/usr/include/lua5.1 +endif +LUALIBS := $(shell which lua-config >/dev/null 2>&1; if [[ $$? == 0 ]]; then lua-config --libs; fi) +ifeq ($(LUALIBS),) +LUALIBS := -llua5.1 +endif + +CPPFLAGS := $(LUAINCLUDE) +LDFLAGS := $(LUALIBS) -lGL -lGLU All: $(TARGET)