# @(#)Makefile 1.15 93/05/19
# Makefile...


#
# If compiling on SunOS 5.x, use the next three lines:
BUILDPIC      = -Kpic
SHAREDLIBLD   = ld -G -o $@ -h $@ $?
XLIB          = \"libX11.so\"


#
# If compiling on SunOS 4.x, use the next three lines:
# BUILDPIC      = -pic
# SHAREDLIBLD   = ld -o $@ -assert pure-text $?
# XLIB          = \"/usr/openwin/lib/libX11.so.1.0\"


#
# Set this if you are not using OpenWindows
XINCLUDEPATH	= $(OPENWINHOME)/include





SHAREDLIB       = superxbell.so
INSTALL_DIR	= /tmp

.PRECIOUS:	$(SHAREDLIB)
#.KEEP_STATE:

CFLAGS 		= -O
CPPFLAGS	= -I$(XINCLUDEPATH) -DXLIB=${XLIB}

all: $(SHAREDLIB) 

$(SHAREDLIB):	superxbell.o
	/bin/rm -f $(SHAREDLIB)
	$(SHAREDLIBLD)

superxbell.o:
	$(CC) $(CFLAGS) $(BUILDPIC) $(CPPFLAGS) -c $< -o $@

main: main.o
	$(CC) main.o -L$(OPENWINHOME)/lib -lX11 -ldl -o $@

main.o: superxbell.c
	$(CC) -g -DMAIN $(CPPFLAGS) -c superxbell.c -o main.o

install: $(SHAREDLIB) FORCE
	/bin/rm -f $(INSTALL_DIR)/$(SHAREDLIB)
	-mkdir -p $(INSTALL_DIR)
	cp $(SHAREDLIB) $(INSTALL_DIR)

tarfile: README superxbell.c Makefile FORCE 
	-mkdir /tmp/superxbell
	-/bin/rm -f /tmp/superxbell/*
	/bin/cp README superxbell.c Makefile *.au /tmp/superxbell
	(cd /tmp; tar cf superxbell.2.0.tar superxbell)
	cp /tmp/superxbell.2.0.tar .

#sharfile: README superxbell.c Makefile FORCE 
#	-mkdir /tmp/superxbell
#	-(cd /tmp/superxbell; /bin/rm -f README superxbell.c Makefile)
#	/bin/cp README superxbell.c Makefile /tmp/superxbell
#	(cd /tmp; shar superxbell > sharfile)

clean: FORCE
	-sccs clean
	-/bin/rm *.o
	-/bin/rm $(SHAREDLIB)


FORCE:

