aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-09-18 23:23:15 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-09-18 23:23:15 +0200
commitdc7751b8e14cc2275c74a673a96bacfd798514fe (patch)
treef5dbb6d4afebe4ce3abc867101be41d8aaf8c4d9 /Makefile
parent108e294d6b132f1cc276ef45178c0cd9f48599d2 (diff)
downloaddns-dc7751b8e14cc2275c74a673a96bacfd798514fe.tar.gz
Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f15ab85..f756f5d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
CC = clang
CFLAGS = -Wall -std=c89 -D_DEFAULT_SOURCE -Wvla \
- -Wdeclaration-after-statement -Wstrict-prototypes -Wpadded \
+ -Wdeclaration-after-statement -Wstrict-prototypes \
-Wunreachable-code -Wsign-compare -Wimplicit-int-conversion \
-Wsign-conversion
LDFLAGS = -lm
@@ -21,6 +21,8 @@ TESTS = $(wildcard $(TESTDIR)/*.c)
TOBJS = $(TESTS:.c=.o)
TSUBS = $(filter-out $(OBJECTDIR)/main.o,$(OBJ))
+RUNARGS = -p 5333
+
build: dir $(OBJ)
@echo [LD] $(OBJ)
@$(CC) $(CFLAGS) -o $(BUILDDIR)/$(OUTPUT) $(OBJ) $(LDFLAGS)
@@ -28,10 +30,12 @@ build: dir $(OBJ)
debug: CFLAGS += -g -D _DEBUG
debug: build;
-test: LDFLAGS += -lcheck
-test: dir $(TOBJS) $(TSUBS)
+build_test: LDFLAGS += -lcheck
+build_test: dir $(TOBJS) $(TSUBS)
@echo [LD] $(TOBJS) $(TSUBS)
@$(CC) $(TESTFLAGS) -o $(TESTDIR)/run $(TOBJS) $(TSUBS) $(LDFLAGS)
+
+test: build_test
@$(TESTDIR)/run
dir:
@@ -49,7 +53,7 @@ $(TESTDIR)/%.o: $(TESTDIR)/%.c
#sudo setcap 'cap_net_bind_service=+ep' /path/to/prog
#to allow port access
run: build
- $(BUILDDIR)/$(OUTPUT)
+ $(BUILDDIR)/$(OUTPUT) $(RUNARGS)
.PHONY: clean
clean: