blob: 5c30e0ca5b61f04f142d0f0410abe4a2c6785ff5 [file] [log] [blame]
# This makefile is dedicated to darwin (and possibly other BSDs)
# You should use it this way :
# make TARGET=os CPU=cpu
# Some optional components may be added, such as DLMALLOC :
# make DLMALLOC_SRC=/usr/local/src/dlmalloc.c \
# OPT_OBJS=src/dlmalloc.o
# Select target OS. TARGET must match a system for which COPTS and LIBS are
# correctly defined below.
TARGET = generic
# pass CPU=<cpu_name> to make to optimize for a particular CPU
CPU = generic
#CPU = native
#CPU = i586
#CPU = i686
#CPU = ultrasparc
# By default, we use libc's regex. WARNING! On Solaris 8/Sparc, group
# references seem broken using libc ! Use pcre instead.
# tools options
CC = gcc
LD = gcc
# This is the directory hosting include/pcre.h and lib/libpcre.* when REGEX=pcre
PCREDIR!= pcre-config --prefix 2>/dev/null || :
# This one can be changed to look for ebtree files in an external directory
EBTREE_DIR = ebtree
# This is for darwin 3.0 and above
LIBS.darwin =
# CPU dependant optimizations
COPTS.generic = -O2
COPTS.native = -O2 -march=native
COPTS.i586 = -O2 -march=i586
COPTS.i686 = -O2 -march=i686
COPTS.ultrasparc = -O6 -mcpu=v9 -mtune=ultrasparc
# options for standard regex library
# options for libpcre
COPTS.pcre=-DUSE_PCRE -I$(PCREDIR)/include
LIBS.pcre=-L$(PCREDIR)/lib -lpcreposix -lpcre
# options for static libpcre
COPTS.static-pcre=-DUSE_PCRE -I$(PCREDIR)/include
LIBS.static-pcre=-L$(PCREDIR)/lib -Wl,-Bstatic -lpcreposix -lpcre -Wl,-Bdynamic
# you can enable debug arguments with "DEBUG=-g" or disable them with "DEBUG="
DEBUG = -g
# if small memory footprint is required, you can reduce the buffer size. There
# are 2 buffers per concurrent session, so 16 kB buffers will eat 32 MB memory
# with 1000 concurrent sessions. Putting it slightly lower than a page size
# will avoid the additionnal paramters to overflow a page. 8030 bytes is
# exactly 5.5 TCP segments of 1460 bytes.
# redefine this if you want to add some special PATH to include/libs
# set some defines when needed.
# Known ones are -DENABLE_POLL
# - use -DTPROXY to compile with transparent proxy support.
# - use -DUSE_GETADDRINFO to use of getaddrinfo() to resolve IPv6 host names
# May be changed to patch PAGE_SIZE on every platform when using dlmalloc
# global options
VERSION != cat VERSION 2>/dev/null || touch VERSION
SUBVERS != cat SUBVERS 2>/dev/null || touch SUBVERS
VERDATE != cat VERDATE 2>/dev/null || touch VERDATE
CFLAGS = -Wall $(COPTS) $(DEBUG) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4
LDFLAGS = -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4
OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocol.o \
src/uri_auth.o src/standard.o src/buffer.o src/log.o src/task.o \
src/chunk.o src/channel.o src/listener.o \
src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o \
src/checks.o src/queue.o src/frontend.o src/proxy.o src/proto_uxst.o \
src/proto_http.o src/raw_sock.o src/appsession.o src/backend.o \
src/peers.o src/stream_interface.o src/dumpstats.o src/proto_tcp.o \
src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \
src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \
src/ev_poll.o src/connection.o \
src/arg.o src/acl.o src/memory.o src/freq_ctr.o \
src/auth.o src/stick_table.o src/sample.o src/compression.o
EBTREE_OBJS = $(EBTREE_DIR)/ebtree.o \
$(EBTREE_DIR)/eb32tree.o $(EBTREE_DIR)/eb64tree.o \
$(EBTREE_DIR)/ebmbtree.o $(EBTREE_DIR)/ebsttree.o \
$(EBTREE_DIR)/ebimtree.o $(EBTREE_DIR)/ebistree.o
all: haproxy
haproxy: $(OBJS) $(EBTREE_OBJS)
$(CC) $(CFLAGS) -c -o $@ $<
src/haproxy.o: src/haproxy.c
-DBUILD_OPTS='"$(COPTS)"' -c -o $@ $<
src/dlmalloc.o: $(DLMALLOC_SRC)
rm -f *.[oas] src/*.[oas] ebtree/*.[oas] haproxy test
for dir in . src include/* doc ebtree; do rm -f $$dir/*~ $$dir/*.rej $$dir/core; done
rm -f haproxy-$(VERSION).tar.gz haproxy-$(VERSION) nohup.out gmon.out