# Makefile for the RISC OS version of tdb


# Define which compiler to use:

CC = cc
#CC = gcc


#########################################
# DO NOT EDIT ANYTHING BELOW THIS LINE! #
#########################################

ifeq (${CC},cc)
CC = cc
LD = link
AR = libfile
DEPEND = -depend !Depend
CC_FLAGS = -Wpc -zo -fw -throwback -Otime -I@,Unix: -JUnix: -D__riscos__ -DHAVE_CONFIG_H
UNIXLIB = Unix:o.UnixLib
else
ifeq (${CC},gcc)
CC = gcc
LD = gcc
AR = ar
CC_FLAGS = -mthrowback -O3 -I. -D__riscos__ -DHAVE_CONFIG_H
else
# No other compiler supported!
endif
endif

TDB_OBJS = o.spinlock o.tdb

.INIT:
	@cdir o	

## Rule Patterns ##

.SUFFIXES:	.c .o

.c.o:
	$(CC) $(CC_FLAGS) $(DEPEND) -c -o $@ $<

# Static dependencies:

all: libtdb tdbdump tdbiterate tdbtool tdbtorture

libtdb: $(TDB_OBJS)
	$(AR) $(AR_FLAGS) -c -o libtdb $(TDB_OBJS)

tdbdump: libtdb o.tdbdump
	$(LD) $(LD_FLAGS) -o tdbdump o.tdbdump libtdb $(UNIXLIB)

tdbiterate: libtdb o.tdbiterate
	$(LD) $(LD_FLAGS) -o tdbiterate o.tdbiterate libtdb $(UNIXLIB)

tdbtool: libtdb o.tdbtool
	$(LD) $(LD_FLAGS) -o tdbtool o.tdbtool libtdb $(UNIXLIB)

tdbtorture: libtdb o.tdbtorture
	$(LD) $(LD_FLAGS) -o tdbtorture o.tdbtorture libtdb $(UNIXLIB)

clean:
	-ifthere libtdb then wipe libtdb ~CFR~V
	-ifthere tdbdump then wipe tdbdump ~CFR~V
	-ifthere tdbiterate then wipe tdbiterate ~CFR~V
	-ifthere tdbtool then wipe tdbtool ~CFR~V
	-ifthere tdbtorture then wipe tdbtorture ~CFR~V
	-ifthere o.* then wipe o.* ~CFR~V

# Dynamic dependencies:
