willy tarreau | 0f7af91 | 2005-12-17 12:21:26 +0100 | [diff] [blame] | 1 | CC = gcc |
| 2 | LD = gcc |
| 3 | |
willy tarreau | 9da061b | 2005-12-17 12:29:56 +0100 | [diff] [blame^] | 4 | # This is for Linux 2.4 |
| 5 | COPTS.linux = -O2 |
| 6 | LIBS.linux = |
willy tarreau | 0f7af91 | 2005-12-17 12:21:26 +0100 | [diff] [blame] | 7 | |
willy tarreau | 9da061b | 2005-12-17 12:29:56 +0100 | [diff] [blame^] | 8 | # This is for solaris 8 |
| 9 | COPTS.solaris = -O2 -fomit-frame-pointer -DSOLARIS -DHAVE_STRLCPY |
| 10 | LIBS.solaris = -lnsl -lsocket |
| 11 | |
| 12 | # Select target OS. TARGET must match a system for which COPTS and LIBS are |
| 13 | # correctly defined above. |
| 14 | TARGET = linux |
| 15 | #TARGET = solaris |
| 16 | |
| 17 | DEBUG = |
| 18 | #DEBUG = -g |
| 19 | |
| 20 | COPTS=$(COPTS.$(TARGET)) |
| 21 | LIBS=$(LIBS.$(TARGET)) |
willy tarreau | 0f7af91 | 2005-12-17 12:21:26 +0100 | [diff] [blame] | 22 | |
willy tarreau | 9da061b | 2005-12-17 12:29:56 +0100 | [diff] [blame^] | 23 | CFLAGS = -Wall $(COPTS) -DSTATTIME=0 |
willy tarreau | 0f7af91 | 2005-12-17 12:21:26 +0100 | [diff] [blame] | 24 | LDFLAGS = -g |
| 25 | |
| 26 | all: haproxy |
| 27 | |
| 28 | haproxy: haproxy.o |
| 29 | $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) |
| 30 | |
| 31 | %.o: %.c |
| 32 | $(CC) $(CFLAGS) -c -o $@ $< |
| 33 | |
| 34 | clean: |
| 35 | rm -vf *.[oas] *~ core haproxy test nohup.out gmon.out |