summaryrefslogtreecommitdiff
path: root/Makefile
blob: 54945cbf170979c7365e2023c18e2a60b3135c64 (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
32
33
34
35
CC := gcc

CFLAGS  = -O2 -std=c99 -Wall -W
LDFLAGS =

INSTALL = /usr/bin/env install
PREFIX	= /usr/local

all: voidnsrun voidnsundo

test: testserver testclient

voidnsrun: voidnsrun.o utils.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

voidnsundo: voidnsundo.o utils.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

testserver: testserver.o utils.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

testclient: testclient.o utils.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

install: voidnsrun voidnsundo
	$(INSTALL) voidnsrun voidnsundo $(PREFIX)/bin
	chmod u+s $(PREFIX)/bin/voidnsrun $(PREFIX)/bin/voidnsundo

clean:
	rm -f *.o voidnsrun voidnsundo testserver testclient

%.o: %.c
	$(CC) $(CFLAGS) -c $^ -I. -o $@

.PHONY: all install clean distclean