#
# WatchOpenDevice
#
# (c) by Matthias Andree 1996/1997
#
# redistributable under GNU public licence
# see file "COPYING" for details
#
# please notify me of any changes you do
# <mandree@dosis.uni-dortmund.de>
#
# to compile, it needs:
# SAS/C (mandatory)
# RevUp (recommended), for keeping the history
#

# default
help:
	@echo "smakefile help:"
	@echo ""
	@echo "supported targets:"
	@echo "clean           - clean up"
	@echo "realclean       - clean everything up"
	@echo "all             - compile"
	@echo "help            - you are reading this"
	@echo "dist            - make distribution archive"

all:    WatchOpenDevice


# what belongs to the distribution
DIST= WatchOpenDevice WatchOpenDev.readme WatchOpenDevice.doc\
  FILE_ID.DIZ WatchOpenDevice.c WatchOpenDev_asm.s\
  smakefile COPYING SCOPTIONS WatchOpenDevice.h\
  WatchOpenDevice_rev.rev WatchOpenDevice_rev.h WatchOpenDevice_rev.log

# objects
OBJS=WatchOpenDevice.o WatchOpenDev_asm.o

WatchOpenDevice.gst: WatchOpenDevice.h SCOPTIONS
	gst unload $@ >NIL:
	sc noobjname mgst $@ $<

WatchOpenDevice.o: WatchOpenDevice.c WatchOpenDevice.gst WatchOpenDevice.h\
 WatchOpenDevice_rev.h SCOPTIONS

WatchOpenDev_asm.o: WatchOpenDev_asm.s SCOPTIONS smakefile

# attn: revup does not touch the file date unless it writes
#       a new log entry, thus, only checking it will not help
#       we need to touch it manually (using setdate)

WatchOpenDevice_rev.h: WatchOpenDevice.c WatchOpenDev_asm.s
	revup 1 $* $*.c c log tiny
	setdate $@

WatchOpenDevice: $(OBJS)
	slink batch to $@ from $(OBJS) lib lib:amiga.lib sc sd od nd

clean:
	-delete \#?.(o|lnk|lha|gst)

realclean: clean
	-delete WatchOpenDevice \#?.info

dist: WatchOpenDev.lha

WatchOpenDev.lha: $(DIST)
	-delete $@
	lha -d0 a $@ $(DIST)

