# Makefile for http_load

# CONFIGURE: If you are using a SystemV-based operating system, such as
# Solaris, you will need to uncomment this definition.
#SYSV_LIBS =	-lnsl -lsocket

# CONFIGURE: If you want to compile in support for https, uncomment these
# definitions.  You will need to have already built OpenSSL, available at
# http://www.openssl.org/  Make sure the SSL_TREE definition points to the
# tree with your OpenSSL installation - depending on how you installed it,
# it may be in /usr/local instead of /usr/local/ssl.
#SSL_TREE =	/usr/local/ssl
#SSL_DEFS =	-DUSE_SSL
#SSL_INC =	-I$(SSL_TREE)/include
#SSL_LIBS =	-L$(SSL_TREE)/lib -lssl -lcrypto

BINDIR =	/usr/local/bin
MANDIR =	/usr/local/man/man1
CYCC =		cyclone
ifdef DEBUG
CFLAGS =        -g $(SSL_DEFS) $(SSL_INC) -pp -save-c $(EXTRACFLAGS)
LDFLAGS =       -g $(SSL_LIBS) $(SYSV_LIBS)
else
CFLAGS =        -O3 $(SSL_DEFS) $(SSL_INC) $(NOCHECK) $(EXTRACFLAGS)
LDFLAGS =       $(SSL_LIBS) $(SYSV_LIBS)
endif

all:		http_load
build: all


HDRS= timers.h port.h 
OBJS=http_load.o timers.o
NC_OBJS = $(addprefix nc_,$(OBJS))


build:		http_load$(EXE)
build-nocheck: http_load-nochk$(EXE)

nc_%.o: %.cyc $(HDRS)
	$(CYCC) --nochecks $(CFLAGS) -c $< -o $@
%.o: %.cyc $(HDRS)
	$(CYCC) $(CFLAGS) -c $< -o $@

http_load$(EXE):	$(OBJS)
	$(CYCC) $(CFLAGS) $^ $(LDFLAGS) -o $@
http_load-nochk$(EXE):	$(NC_OBJS)
	$(CYCC) $(CFLAGS) $^ $(LDFLAGS) -o $@


install:	all
	rm -f $(BINDIR)/http_load
	cp http_load $(BINDIR)
	rm -f $(MANDIR)/http_load.1
	cp http_load.1 $(MANDIR)


clean:
	rm -f http_load$(EXE) http_load-nochk$(EXE) *.o core core.* *.core *~
