forked from jtripper/dns-tcp-socks-proxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (36 loc) · 717 Bytes
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
ifeq "$(ARCH)" ""
override ARCH := $(shell uname -m)
endif
CFLAGS=-Wall -c -I.
AS=$(CC) -c
LIBS=-lresolv
DNSPROXY=dns_proxy.o coroutine-ucontext.o qemu-coroutine.o local_ns_parser.o
LIB=libtask.a
ifeq ($(ARCH),mips)
ASM=asm.o
OFILES=$(ASM) context.o
endif
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CFLAGS += -D_XOPEN_SOURCE
else
LIBS += -pthread
endif
all: $(LIB) dns_proxy
%.o: %.S
$(AS) $*.S
%.o: %.c
$(CC) $(CFLAGS) $*.c
$(LIB): $(OFILES)
ifeq ($(ARCH),mips)
ar rvc $(LIB) $(OFILES)
endif
dns_proxy: $(DNSPROXY) $(LIB)
ifeq ($(ARCH),mips)
$(CC) $(LIBS) -o dns_proxy $(DNSPROXY) $(LIB)
else
$(CC) $(LIBS) -o dns_proxy $(DNSPROXY)
endif
.PHONY: clean
clean:
-rm -f dns_proxy *.o *.a