[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Dogfood v1.0.2 has been released; an alternative for building self contained Lua executables
- From: "Jasper Klein" <jasper@...>
- Date: Thu, 27 Aug 2020 16:21:23 +0200
diff -r ../Downloads/dogfood-master/makefile dogfood-master/makefile
< $(CC) $(CFLAGS) -shared -o $@ -fPIC $+
> $(CC) $(CFLAGS) -bundle -undefined dynamic_lookup -o $@ $+
The flags to build the module on macOS are not accepted by GCC on Linux.
I will try to find a solution for it.
With the following diff the makefile should build for Linux and macOS.
I don´t know if there are exceptions for other platforms.
If someone has a suggestion, tell me about it so I can fix the makefile.
@@ -3,6 +3,13 @@ CFLAGS = -Wall -Wextra -Wpedantic -O3
INCLUDES = -I "./src"
LDFLAGS = -llua
+OS = $(shell uname -s)
+ LIB_FLAGS = -bundle -undefined dynamic_lookup
+ LIB_FLAGS = -shared -fPIC
SRCDIR = src/
OUTDIR = out/
TSTDIR = test/
@@ -54,7 +61,7 @@ $(OUTDIR)foobar: $(OUTDIR)dogfood $(TSTDIR)foo.lua $(TSTDIR)bar.lua $(TSTDIR)bar
chmod u+x $@
- $(CC) $(CFLAGS) -shared -o $@ -fPIC $+
+ $(CC) $(CFLAGS) $(LIB_FLAGS) -o $@ $+
# By copying pg1003.so to pg1005.so we have created an invalid lua library (wrong entry point) that is used to test dogfood