#
#  Makefile for CRXVT
#
#
# Add -DPRINT_PIPE if you want support for an emulation of an attached 
# vt100 printer.
#
# Add -DUSE_XCOPYAREA if you think that use of XCopyArea commands 
# (in place of re-draws) will speed up rxvt. I have been told that this
# helps with some graphics adapters like the PC's et4000. OK, its good
# on mono-chrome Sun-3's that I've tried too.
#
# -DMAX_REFRESH_PERIOD=10 means that rxvt will skip no more than
# 10 screenfulls between screen refreshes during hard & fast scrolling
#
# Use -DFAKE_RESOURCES to use my hack which provides a substitute for
# using XGetDefaults. If all you want to do is put rxvt defaults in your
# .Xdefaults file, use this, and save 60-160Kbytes memory!
# Use -DREAL_RESOURCES to use XGetDefaults.
# Leave off both options to blow off the Xdefaults altogether.
#
# Use -DCOLOR to get ANSI color in rxvt
# Use -DGRAPHICS to get my own little graphics mode.
#
# Use -DMULTIPLE_CLICKS for double and triple click selection support
# Integrated by A. Haritsis <ah@doc.ic.ac.uk>, based on code by:
# Edward. Der-Hua Liu, Taiwan
#
# Use -DMAPALERT to enable automatic de-iconify when a bell is displayed
#
# Rxvt now include optional utmp support.
# including utmp support allows rxvt to update /etc/utmp so
# that the commands who and w show rxvt logins.
# In order for this to work, /etc/utmp must be world writeable, or
# rxvt must be setuid root.
# to make rxvt setuid root, do this
# su
# chown root.root rxvt
# chmod a+s rxvt
# Do it at your own risk. 


include ../config.status 
include ../install.status


EXTRA_DEFINES = @EXTRA_DEFINES@
EXTRA_LIBS    = @EXTRA_LIBS@


SRCS = rxvt.c command.c sbar.c screen.c utmp.c xsetup.c debug.c \
       resources.c graphics.c
 
OBJS = rxvt.o command.o sbar.o screen.o utmp.o xsetup.o debug.o \
       resources.o graphics.o cli_xcin.o 

INCS = command.h rxvt.h sbar.h xsetup.h debug.h rxvt_graphics.h screen.h

all: crxvt

crxvt: $(OBJS)
	$(CC) -o $@ $(OBJS) $(LIB_PATH) $(LIBS) $(EXTRA_LIBS)

.c.o:
	$(CC) -c -o $*.o $(CFLAGS) $(INC_PATH) $(DEFS) $(EXTRA_DEFINES) $<

rxvt.o: rxvt.c command.h xsetup.h screen.h sbar.h rxvt.h debug.h

command.o: command.c rxvt.h command.h screen.h xsetup.h sbar.h

sbar.o: sbar.c rxvt.h xsetup.h command.h sbar.h

screen.o: screen.c rxvt.h screen.h command.h xsetup.h sbar.h debug.h

utmp.o: utmp.c 

xsetup.o: xsetup.c rxvt.h command.h xsetup.h screen.h sbar.h debug.h

debug.o: debug.c debug.h

resources.o: resources.c rxvt.h command.h xsetup.h screen.h sbar.h debug.h

graphics.o: graphics.c rxvt.h screen.h command.h xsetup.h sbar.h debug.h rxvt_graphics.h

cli_xcin.o:
	ln -s ../xcin/cli_xcin.o cli_xcin.o

install: crxvt
	if [ ! -d $(PATH_XCIN_BIN) ]; then $(INSTALL_DIR) $(PATH_XCIN_BIN); fi
	$(INSTALL) crxvt $(PATH_XCIN_BIN)
	chmod u+s $(PATH_XCIN_BIN)/crxvt
	echo $(PATH_XCIN_BIN)/crxvt >> filelist

clean:
	rm -f *.o core crxvt filelist

veryclean: clean
	rm -f Makefile
