summaryrefslogtreecommitdiff
path: root/package/mongrel2/patches/patch-tools_m2sh_Makefile
blob: abec82a1fc3a5cad4d4f7c3577710a4777ef2630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- mongrel2-v1.13.0.orig/tools/m2sh/Makefile	2021-12-25 01:03:28.000000000 +0100
+++ mongrel2-v1.13.0/tools/m2sh/Makefile	2024-02-22 19:03:20.332596928 +0100
@@ -1,7 +1,8 @@
-CFLAGS=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
+CFLAGS?=
+CFLAGS+=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
 LIBS=-lzmq -lsqlite3 ../../build/libm2.a $(OPTLIBS)
 
-PREFIX?=/usr/local
+PREFIX?=/usr
 SOURCES=$(wildcard src/*.c src/**/*.c)
 OBJECTS=$(patsubst %.c,%.o,${SOURCES})
 TEST_SRC=$(wildcard tests/*.c)
@@ -12,7 +13,7 @@ RAGEL_OBJECTS=src/lexer.o src/cli.o
 
 $(RAGEL_OBJECTS): CFLAGS += -Wno-unused-const-variable -Wimplicit-fallthrough=0 -Wno-unused-parameter
 
-all: ../lemon/lemon tests build/m2sh
+all: ../lemon/lemon build/m2sh
 
 dev: CFLAGS=-g -Wall -Wextra -Isrc -I../../src $(OPTFLAGS)
 dev: all
@@ -32,7 +33,7 @@ build/m2sh: ../lemon/lemon ../../build/l
 	$(CC) $(CFLAGS) -o build/m2sh ${OBJECTS} ../../build/libm2.a $(LDFLAGS) $(LIBS)
 
 ../lemon/lemon: ../lemon/lemon.c
-	$(CC) -O2 ../lemon/lemon.c -o ../lemon/lemon
+	$(CC) $(CFLAGS) ../lemon/lemon.c -o ../lemon/lemon
 
 tests: build/libm2sh.a ${TESTS}
 	sh ./tests/runtests.sh