# Before making all or any of these, you need to define UDFOLD
# Also, you should create a directory in it called 'tools' and
# place that in your PATH.
# Then, make all, and you will have:

# 1. rs  -- reads the supplied list of sectors and sends them to
#           stdout.
# 2. rb  -- symlink to rs which adds in the environment variable BIAS,
#           so that if it is set to the sector number of block 0, the
#           block address may be used instead of sector address.
# 3. st  -- decodes stdin according to  to UDF/13346
# 4. hex -- dumps stdin in hex (and ascii?)

# NOTE that to use these, more environment variables must be set....
# See the rs.c source.
# -DVM 5/30/96

CC=/bin/cc
CFLAGS=-g -Aa -DOSACODE -I$(UDFOLD)/src/nsrHdrs -I$(UDFOLD)/include
TOOLDIR=$(UDFOLD)/tools

$(TOOLDIR)/st:     st.c $(UDFOLD)/src/nsrCore/o_struct.c
	$(CC) $(CFLAGS) -c st.c 
	$(CC) $(CFLAGS) -c $(UDFOLD)/src/nsrCore/o_struct.c
	$(CC) -o st st.o o_struct.o
	rm -f $(TOOLDIR)/st
	mv st $(TOOLDIR)/st

$(TOOLDIR)/hex:    hex.c
	$(CC) $(CFLAGS) -o hex hex.c
	rm -f $(TOOLDIR)/hex
	mv hex $(TOOLDIR)/hex

$(TOOLDIR)/rs:     rs.c
	$(CC) $(CFLAGS) -o rs rs.c
	rm -f $(TOOLDIR)/rs
	mv rs $(TOOLDIR)/rs

$(TOOLDIR)/rb:     $(TOOLDIR)/rs
	rm -f $(TOOLDIR)/rb
	ln -s $(TOOLDIR)/rs $(TOOLDIR)/rb

all: $(TOOLDIR)/st $(TOOLDIR)/hex $(TOOLDIR)/rs $(TOOLDIR)/rb
