diff options
author | Martin Peach <mrpeach@users.sourceforge.net> | 2011-03-17 18:47:22 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 14:28:31 +0200 |
commit | 75f1f5cb6bc8036927ccc487e3b0987c77e14aea (patch) | |
tree | 0e19ba503e7ca8dccf823fc636463d612803ae01 | |
parent | 267170167d52cab9e97f879d9127a1cf04f6bb58 (diff) |
Use pkg-config to find lua header and lib (will this work with MinGW?)
svn path=/trunk/externals/loaders/pdlua/; revision=15036
-rw-r--r-- | src/Makefile | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile index 4ade6ff..505e0a7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -37,7 +37,13 @@ EXTRA_DIST = nothing # Lua setup #CFLAGS += -ansi -pedantic -O2 -fPIC -I/usr/include/lua5.1 -I"$(PD_INCLUDE)/pd" -Wall -W -g LDFLAGS = -LIBS = -llua5.1 +LIBS = +#LUACFLAGS = -DPD -DVERSION='"$(LIBRARY_VERSION)"' +#LUACFLAGS += -fPIC -I"/usr/include/lua5.1" -I"$(PD_INCLUDE)/pd" -g +LUACFLAGS = `pkg-config lua5.1 --cflags` +LIBS = `pkg-config lua5.1 --libs` +LUACFLAGS += -DVERSION='"$(LIBRARY_VERSION)"' +#LUACFLAGS += -DPD -fPIC -I"/usr/include/lua5.1" -I"$(PD_INCLUDE)/pd" -g #------------------------------------------------------------------------------# # @@ -48,8 +54,6 @@ LIBS = -llua5.1 # get library version from meta file LIBRARY_VERSION = $(shell sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' $(LIBRARY_NAME)-meta.pd) -LUACFLAGS = -DPD -DVERSION='"$(LIBRARY_VERSION)"' -LUACFLAGS += -fPIC -I"/usr/include/lua5.1" -I"$(PD_INCLUDE)/pd" -g PD_INCLUDE = $(PD_PATH)/include # where to install the library, overridden below depending on platform @@ -216,9 +220,11 @@ all: $(SOURCES:.c=.$(EXTENSION)) %.o: %.c @echo "compiling $(LIBRARY_NAME) version $(LIBRARY_VERSION)" @echo "cflags are $(CFLAGS)" - @echo "optflags are $(OPTFLAGS)" + @echo "optcflags are $(OPT_CFLAGS)" @echo "luacflags are $(LUACFLAGS)" - $(CC) $(CFLAGS) $(OPTFLAGS) $(LUACFLAGS) -o "$*.o" -c "$*.c" + @echo "ldflags are $(LDFLAGS)" + @echo "libs are $(LIBS)" + $(CC) $(CFLAGS) $(OPT_CFLAGS) $(LUACFLAGS) -o "$*.o" -c "$*.c" %.$(EXTENSION): %.o @echo "linking $(LIBRARY_NAME) with $(LIBS)" |