summaryrefslogtreecommitdiff
path: root/Makefile
blob: 479dbe772c43ab722d7874f0d016c9f68477610a (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: test/testserver.o utils.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

testclient: test/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 test/*.o voidnsrun voidnsundo testserver testclient

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

.PHONY: all install clean distclean