#
# $Id: smakefile 4.27 1998/11/01 10:22:43 olsen Exp olsen $
#
# :ts=8
#

.c.o:
	sc $(CFLAGS) $<
	@ctags >tagfiles/$* $<

.a.o:
	asm $(AFLAGS) $<

#############################################################################
#
# Program version and revision; must match the data in the bumprev file
# as it's used to check in and freeze a release.
#
#############################################################################

VERSION =	4
REVISION =	28

SYMBOLIC_NAME =	V$(VERSION)_$(REVISION)

###############################################################################

SOURCE =	base.c user.c task.c ables.a prefsfile.a

HEADERS =	global.h protos.h

OTHER =		Assert.c Assert.h smakefile releasenotes

###############################################################################

OPTIMIZE =	optimize opttime optschedule optinline optdepth=100
DEBUG =		debug=line

CFLAGS =	$(OPTIMIZE) $(DEBUG) params=r nostackcheck \
		data=faronly idir=include stringmerge cpu=060
LFLAGS =	smallcode noicons

AFLAGS =	-d -u

OBJS =		base.o user.o task.o ables.o
LIBS =		lib:scnb.lib lib:amiga.lib lib:debug.lib

all: tagfiles concierto.audio concierto

tagfiles:
	makedir $@

concierto.audio: $(OBJS) Assert.o
	slink $(OBJS) to $@.debug lib $(LIBS) Assert.o $(LFLAGS) addsym \
		map $@.map,fhx fwidth 32 pwidth 32 swidth 32
	slink $@.debug to $@ noicons nodebug
	@type >tags tagfiles/\#?

concierto: prefsfile.a
	echo >concierto_rev.rev `eval $(REVISION) - 1`
	bumprev $(VERSION) concierto
	basm -ua+ -oconcierto -iinclude/ prefsfile.a

###############################################################################

clean:
	-delete concierto.audio concierto.audio.debug concierto $(OBJS) tagfiles tags all

realclean: clean
	-delete ID

version:
	echo >concierto.audio_rev.rev `eval $(REVISION) - 1`
	bumprev $(VERSION) concierto.audio

install: concierto.audio
	copy concierto.audio devs:ahi/concierto.audio
	copy concierto devs:audiomodes/concierto
	addaudiomodes refresh

mkid:
	mkid -v \#?.(c|h|a|asm|i)

update:
	mkid -v -u

###############################################################################

Assert.o: Assert.c Assert.h
base.o: base.c Assert.h global.h protos.h concierto.audio_rev.h
user.o: user.c Assert.h global.h protos.h
task.o: task.c Assert.h global.h protos.h
ables.o: ables.a

###############################################################################

checkin:
	ci -q -M -d -l$(VERSION) -m. -t-. $(SOURCE) $(HEADERS) $(OTHER)

lock:
	rcs -l $(SOURCE) $(HEADERS) $(OTHER)

unlock:
	rcs -u $(SOURCE) $(HEADERS) $(OTHER)

freeze:
	rcs -q -n$(SYMBOLIC_NAME): $(SOURCE) $(HEADERS) $(OTHER)
