-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (41 loc) · 888 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
47
48
49
# Compiler
CC=gcc
OS=$(shell uname)
# Compiler flags
INCLUDES=
CFLAGS=-c -Wall -std=gnu99 $(INCLUDES) -D_REENTRANT -D_PROXY_DEBUG
LDFLAGS=-lm -lpthread
ifeq ($(OS),SunOS)
LDFLAGS+=-lsocket -lnsl
endif
# Sources
SOURCES=main.c\
sockets-handler.c\
pstring.c\
cache.c\
proxy-handler.c\
proxy-client-handler.c\
proxy-target-handler.c\
http-parser.c\
proxy-utils.c
HEADERS=sockets-handler.h\
pstring.h\
cache.h\
proxy-handler.h\
proxy-client-handler.h\
proxy-target-handler.h\
http-parser.h\
proxy-utils.h
# Compiler output
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=yx-proxy
all: $(HEADERS) $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) -o $@ $(LDFLAGS)
%.o: %.c Makefile
$(CC) $(CFLAGS) $< -o $@
clean:
rm -rf $(OBJECTS) $(EXECUTABLE)
clear: clean
rebuild: clean all
.PHONY: all clear rebuild $(SOURCES)