blob: 88ed19c9a124b21eec47e3d8b884a641942d3db4 [file] [log] [blame]
willy tarreau0f7af912005-12-17 12:21:26 +01001CC = gcc
2LD = gcc
3
willy tarreau5cbea6f2005-12-17 12:48:26 +01004# This is for Linux 2.4 with netfilter
5COPTS.linux24 = -O2 -DNETFILTER
6LIBS.linux24 =
willy tarreau0f7af912005-12-17 12:21:26 +01007
willy tarreau5cbea6f2005-12-17 12:48:26 +01008# This is for Linux 2.2
9COPTS.linux22 = -O2 -DUSE_GETSOCKNAME
10LIBS.linux22 =
11
12# This is for Solaris 8
willy tarreau9da061b2005-12-17 12:29:56 +010013COPTS.solaris = -O2 -fomit-frame-pointer -DSOLARIS -DHAVE_STRLCPY
14LIBS.solaris = -lnsl -lsocket
15
willy tarreau5cbea6f2005-12-17 12:48:26 +010016# This is for OpenBSD 3.0
17COPTS.openbsd = -O2 -DHAVE_STRLCPY
18LIBS.openbsd =
19
willy tarreau9da061b2005-12-17 12:29:56 +010020# Select target OS. TARGET must match a system for which COPTS and LIBS are
21# correctly defined above.
willy tarreau5cbea6f2005-12-17 12:48:26 +010022TARGET = linux24
23#TARGET = linux22
willy tarreau9da061b2005-12-17 12:29:56 +010024#TARGET = solaris
willy tarreau5cbea6f2005-12-17 12:48:26 +010025#TARGET = openbsd
willy tarreau9da061b2005-12-17 12:29:56 +010026
willy tarreau5cbea6f2005-12-17 12:48:26 +010027#DEBUG =
28DEBUG = -g
willy tarreau9da061b2005-12-17 12:29:56 +010029
30COPTS=$(COPTS.$(TARGET))
31LIBS=$(LIBS.$(TARGET))
willy tarreau0f7af912005-12-17 12:21:26 +010032
willy tarreau5cbea6f2005-12-17 12:48:26 +010033# - use -DSTATTIME=0 to disable statistics, else specify an interval in
34# milliseconds.
willy tarreaua1598082005-12-17 13:08:06 +010035# - use -DTPROXY to compile with transparent proxy support.
36CFLAGS = -Wall $(COPTS) $(DEBUG) -DSTATTIME=0 -DTPROXY
willy tarreau0f7af912005-12-17 12:21:26 +010037LDFLAGS = -g
38
39all: haproxy
40
41haproxy: haproxy.o
42 $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
43
44%.o: %.c
45 $(CC) $(CFLAGS) -c -o $@ $<
46
47clean:
willy tarreauc29948c2005-12-17 13:10:27 +010048 rm -f *.[oas] *~ core haproxy test nohup.out gmon.out
willy tarreauefae1842005-12-17 12:51:03 +010049