# makefile for regenerating lookup tables for limaribu

# The purpose of this program is to precompute the data that limaribu
# uses to make decisions for the computer opponent.  Recomputation of
# the data is only needed if the rules are changed.  The precomputed
# data is stored in msx/tabmain.as and msx/boom.as in a format that is
# suitable for processing with a z80 assembler and linking to code
# compiled with HiTech C.  This makefile is written for GNU make, but
# the program is written in portable C and should be useable other
# platforms as well.

#CC = gcc
#CFLAGS = -g -Wall

SRC =  5000tact.c 5000spel.c 5000init.c 5000verw.c remap.c
H = 5000spel.h

all: msx/tabmain.as msx/boom.as

dist: limaribu-recompute.zip

msx/tabmain.as msx/boom.as : 5000spel
	mkdir -p msx
	echo 0 0 | ./5000spel

5000spel:  $(SRC:.c=.o)
	$(CC) $^ -o $@ -lm

OBJ = $(SRC:.c=.o)

$(OBJ) :  $(H)

limaribu-recompute.zip: makefile $(SRC) $(H)
	cd .. ; zip -f  limaribu/$@  $(^:%=limaribu/%)
