From cd8c03a05a93e2cdf2134321b5e70d8d1441f9ee Mon Sep 17 00:00:00 2001
From: Florian Franzmann <bwlf@bandrate.org>
Date: Sat, 4 Jun 2022 15:44:51 +0200
Subject: [PATCH] Respect CC, CFLAGS, LDFLAGS

---
 makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/makefile b/makefile
index 1e32195..d57098e 100644
--- a/makefile
+++ b/makefile
@@ -22,8 +22,7 @@ CWARNS = -Wall -Wextra -pedantic \
 # -Wunreachable-code \
 
 
-CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC
-CC = gcc
+CFLAGS += $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC
 
 FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o
 
@@ -36,7 +35,7 @@ macosx:
 	$(MAKE) lpeg.so "DLLFLAGS = -bundle -undefined dynamic_lookup"
 
 lpeg.so: $(FILES)
-	env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so
+	env $(CC) $(CFLAGS) $(LDFLAGS) $(DLLFLAGS) $(FILES) -o lpeg.so
 
 $(FILES): makefile
 
-- 
2.36.1

