# Define RESOLV_LIB if your system (e.g., SunOS before 4.1.1)
# doesn't search resolver library automatically.
# Leave it undefined otherwise.
# If your compiler or loader complains about _res_init being
# an undefined symbol, then you must define RESOLV_LIB.
#RESOLV_LIB= -lresolv
#
# IRIX should use the next three lines:
#RESOLV_LIB=-lsun
#CCKR=-cckr
#RANLIB=/bin/true

# Directory into which rxmosaic program will be installed:
BIN_DEST_DIR=/usr/local/bin

# Directory into which rxmosaic's man page file will be installed:
MAN_DEST_DIR=/usr/local/man/mann

SOCKS_LIB=../../lib/libsocks.a

# The 'install' command is assumed to be the BSD variety (using -m to
# set the file mode). If the default 'install' on your system doesn't
# do that, you have to either specify an alternative one in the line below
# (e.g., /usr/ucb/install) or modify the install instructions.
INSTALL= install

#==============================================================================

all: echocwd LIBWWW LIBHTMLW RXMOSAIC

LIBWWW:
	(cd libwww; $(MAKE) RANLIB=$(RANLIB) CCKR=$(CCKR))

LIBHTMLW:
	(cd libhtmlw; $(MAKE) RANLIB=$(RANLIB) CCKR=$(CCKR))

RXMOSAIC:
	(cd src; $(MAKE) SOCKS_LIB=$(SOCKS_LIB) RESOLV_LIB=$(RESOLV_LIB) CCKR=$(CCKR))

install: echocwd rxmosaic
	$(INSTALL) -m 111 rxmosaic $(BIN_DEST_DIR)

install.man: echocwd
	$(INSTALL) -m 444 rxmosaic.n $(MAN_DEST_DIR)

clean: echocwd
	rm -f rxmosaic
	for i in libwww libhtmlw src; do (cd $$i; $(MAKE) clean) done

echocwd:
	@pwd
