# Makefile for http_get

# 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_INCDIR and SSL_LIBDIR
# definitions point to your OpenSSL installation.
#SSL_INCDIR =	/usr/local/include
#SSL_LIBDIR =	/usr/local/lib
#SSL_DEFS =	-DUSE_SSL
#SSL_INC =	-I$(SSL_INCDIR)
#SSL_LIBS =	-L$(SSL_LIBDIR) -lssl -lcrypto -lRSAglue -lrsaref

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

OBJS=http_get.o
NC_OBJS = $(addprefix nc_,$(OBJS))

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

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

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



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



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