srcdir   = @srcdir@
VPATH    = @srcdir@

prefix = @prefix@
libdir = $(prefix)/lib

INSTALL  = @INSTALL@
BINRM    = @BINRM@
CC	 = @CC@
CFLAGS   = @CFLAGS@ @CDEBUG_FLAGS@ @DEFS@ -I$(srcdir) -I.

all: Makefile socksraw.h

Makefile: $(srcdir)/Makefile.in ../config.status
	(cd ..; CONFIG_FILES=include/Makefile CONFIG_HEADERS= ./config.status)

socksraw.h: socks.h
	$(CC) $(CFLAGS) -E -DSOCKS $(srcdir)/socks.h -o socksraw.h
	$(CC) $(CFLAGS) -E -dM -DSOCKS $(srcdir)/socks.h >> socksraw.h

install: 
	@( if [ ! -d $(prefix)/include ]; then mkdir -p $(prefix)/include; fi )
	$(INSTALL) -m 644 $(srcdir)/socks.h $(prefix)/include

clean:
	-$(BINRM) socksraw.h 

distclean: clean
	-$(BINRM) Makefile config.h *~ #*# *.bak
