#
# Makefile
#
# Random stuff
#

CC =	cc

# rand_config
#	checks type sizes and byte order

rand_config: rand_config.c
	$(PURIFY) $(LD) -o rand_config rand_config.c

# random_cfg.h
#	output from rand_config

random_cfg.h: rand_config
	rm -f random_cfg.h
	./rand_config > random_cfg.h

# random.o

random.o: random.h random_cfg.h random.c
	$(CC) -c random.c

# random_test
#	generates some random numbers

random_test: random.o random_test.c
	$(PURIFY) $(LD) -o random_test random_test.c random.o

# test
#	check the test output

test: random_test
	rm -f test.out
	./random_test > test.out
	diff good.out test.out

# clean

clean:
	rm -f *.o *~ random_test rand_config random_cfg.h test.out
