summaryrefslogtreecommitdiff
blob: 3c9516cf4033d3005095ed9c2c8ea33ca337a7d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- a/Makefile	2021-04-14 20:14:37.824271249 +0200
+++ b/Makefile	2021-04-14 20:15:18.498590911 +0200
@@ -53,13 +53,13 @@
 all:: moonbridge moonbridge_io.so
 
 moonbridge: moonbridge.c moonbridge_io.h moonbridge_io.o
-	cc -Wall -Wno-unused-result -O2 -Wl,-E -I $(LUA_INCLUDE) -L $(LUA_LIBDIR) -o moonbridge $(MOONBR_LUA_PATH_DEFINE) $(MOONBR_LUA_CPATH_DEFINE) moonbridge.c -lm -l$(LUA_LIBRARY) $(UTIL_FLAGS) moonbridge_io.o
+	$(CC) -Wall -Wno-unused-result $(CFLAGS) -Wl,-E -I $(LUA_INCLUDE) -L $(LUA_LIBDIR) -o moonbridge $(MOONBR_LUA_PATH_DEFINE) $(MOONBR_LUA_CPATH_DEFINE) moonbridge.c $(LUA_LIBRARY) $(UTIL_FLAGS) moonbridge_io.o $(LDFLAGS)
 
 moonbridge_io.o: moonbridge_io.c moonbridge_io.h
-	cc -c -Wall -O2 -fPIC -I $(LUA_INCLUDE) -o moonbridge_io.o moonbridge_io.c
+	$(CC) -c -Wall $(CFLAGS) -fPIC -I $(LUA_INCLUDE) -o moonbridge_io.o moonbridge_io.c
 
 moonbridge_io.so: moonbridge_io.o
-	ld -shared -o moonbridge_io.so moonbridge_io.o $(UTIL_FLAGS)
+	$(CC) -shared -o moonbridge_io.so moonbridge_io.o $(UTIL_FLAGS) $(LUA_LIBRARY)
 
 clean::
 	rm -f moonbridge moonbridge_io.o moonbridge_io.so