2005-12-17 11:21:26 +00:00
|
|
|
CC = gcc
|
|
|
|
LD = gcc
|
|
|
|
|
2005-12-17 11:48:26 +00:00
|
|
|
# This is for Linux 2.4 with netfilter
|
|
|
|
COPTS.linux24 = -O2 -DNETFILTER
|
|
|
|
LIBS.linux24 =
|
2005-12-17 11:21:26 +00:00
|
|
|
|
2005-12-17 11:48:26 +00:00
|
|
|
# This is for Linux 2.2
|
|
|
|
COPTS.linux22 = -O2 -DUSE_GETSOCKNAME
|
|
|
|
LIBS.linux22 =
|
|
|
|
|
|
|
|
# This is for Solaris 8
|
2005-12-17 11:29:56 +00:00
|
|
|
COPTS.solaris = -O2 -fomit-frame-pointer -DSOLARIS -DHAVE_STRLCPY
|
|
|
|
LIBS.solaris = -lnsl -lsocket
|
2005-12-17 11:21:26 +00:00
|
|
|
|
2005-12-17 11:48:26 +00:00
|
|
|
# This is for OpenBSD 3.0
|
|
|
|
COPTS.openbsd = -O2 -DHAVE_STRLCPY
|
|
|
|
LIBS.openbsd =
|
|
|
|
|
2005-12-17 11:29:56 +00:00
|
|
|
# Select target OS. TARGET must match a system for which COPTS and LIBS are
|
|
|
|
# correctly defined above.
|
2005-12-17 11:48:26 +00:00
|
|
|
TARGET = linux24
|
|
|
|
#TARGET = linux22
|
2005-12-17 11:29:56 +00:00
|
|
|
#TARGET = solaris
|
2005-12-17 11:48:26 +00:00
|
|
|
#TARGET = openbsd
|
2005-12-17 11:29:56 +00:00
|
|
|
|
2005-12-17 11:48:26 +00:00
|
|
|
#DEBUG =
|
|
|
|
DEBUG = -g
|
2005-12-17 11:29:56 +00:00
|
|
|
|
|
|
|
COPTS=$(COPTS.$(TARGET))
|
|
|
|
LIBS=$(LIBS.$(TARGET))
|
|
|
|
|
2005-12-17 11:48:26 +00:00
|
|
|
# - use -DSTATTIME=0 to disable statistics, else specify an interval in
|
|
|
|
# milliseconds.
|
2005-12-17 12:08:06 +00:00
|
|
|
# - use -DTPROXY to compile with transparent proxy support.
|
|
|
|
CFLAGS = -Wall $(COPTS) $(DEBUG) -DSTATTIME=0 -DTPROXY
|
2005-12-17 11:21:26 +00:00
|
|
|
LDFLAGS = -g
|
|
|
|
|
|
|
|
all: haproxy
|
|
|
|
|
|
|
|
haproxy: haproxy.o
|
|
|
|
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -vf *.[oas] *~ core haproxy test nohup.out gmon.out
|
2005-12-17 11:51:03 +00:00
|
|
|
|