diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2021-09-18 23:23:15 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2021-09-18 23:23:15 +0200 |
commit | dc7751b8e14cc2275c74a673a96bacfd798514fe (patch) | |
tree | f5dbb6d4afebe4ce3abc867101be41d8aaf8c4d9 | |
parent | 108e294d6b132f1cc276ef45178c0cd9f48599d2 (diff) | |
download | dns-dc7751b8e14cc2275c74a673a96bacfd798514fe.tar.gz |
Makefile
-rw-r--r-- | Makefile | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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: |