# 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


BINDIR =	/usr/local/bin
MANDIR =	/usr/local/man/man1

ifdef DEBUG
CFLAGS =	-g $(SSL_DEFS) $(SSL_INC) $(EXTRACFLAGS)
LDFLAGS =	-g $(SSL_LIBS) $(SYSV_LIBS)
else
CFLAGS =	-O3 $(SSL_DEFS) $(SSL_INC) $(EXTRACFLAGS)
LDFLAGS =	$(SSL_LIBS) $(SYSV_LIBS)
endif

build:		http_get$(EXE)

http_get$(EXE):	http_get.c
	$(CC) $(CFLAGS) http_get.c $(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) *.o core core.* *.core *~
