# This MAKEFILE seems to work with the default Linux 'make'
WP2X_DIR=/usr/local/lib/wp2x
DESTBIN=/usr/local/bin
INSTALLDIRS=cfgs filters inputs outputs
SRCS=wp2x.c dopen.c tokens.c charsets.c getopt.c
# Note: If you don't have mcp, use cp and remove the quotes when CP is used.
CP=mcp -v

# set this for makedepend (???)
#GCCINC=/milkyway/tools/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.0/include
#GCCINC=/milkyway/tools/lib/gcc-lib/i386-bsdi2.0-bsd386/2.6.3/include
# Include getopt.o if you don't have getopt(3)
#OBJS=wp2x.o dopen.o tokens.o charsets.o getopt.o
OBJS=wp2x.o dopen.o tokens.o charsets.o

#CC=cc -g -O -ansi -funsigned-char
# use GCC if it isn't standard
CC=gcc -g -O -ansi -funsigned-char
VERSION=2.3p2
CFLAGS= -DUNIX -DWP2X_DIR=\"$(WP2X_DIR)/cfgs\" -DVERSION=\"$(VERSION)\"

wp2x: $(OBJS)
	$(CC) -s -o wp2x $(CFLAGS) $(OBJS)

clean:
	rm -f wp2x wp2x.exe *.o

install: wp2x
	$(CP) wp2x $(DESTBIN)
	test -d $(WP2X_DIR) || mkdir $(WP2X_DIR)
	for i in $(INSTALLDIRS); do \
		test -d $(WP2X_DIR)/$$i || mkdir $(WP2X_DIR)/$$i; \
		$(CP) "$$i/*" $(WP2X_DIR)/$$i ; done

