#
# Make file for cctl
# cli program to show or set the state of various parts of the
# EP9301 core.
# 
# Makefile for arm-linux cross compilation on i386 debian box,
# using the arm crosstool kit provided by Technologic Systems
# for the TS-7200 ARM SBC

SHELL		= /bin/sh

DEMOS		= 
PROGS		= cctl

srcdir		= .

# **** CUSTOMISE THESE ******

includedir	= $(HOME)/include
INSDIR		= $(HOME)/export/work/bin
#MANDIR		= /usr/local/man/man1
#LOCALINS	= $(HOME)/bin
#LOCALMAN	= $(HOME)/man/man1

# ***************************
CC		= arm-linux-gcc
#CC		= gcc
CFLAGS		= -O
CPPFLAGS	= -I. -I$(includedir)

CCFLAGS		= $(CFLAGS) $(CPPFLAGS)

LINK		= $(CC)

#
# libraries

#LDFLAGS	= 
#LDFLAGS	= 
#LDFLAGS	= -static

cctl		= cctl.o scsubs.o ts7200io.o

# if there is an include file uncomment this. Add anyother dependancies
#cctl.o: cctl.h

.c.o:
	$(CC) -c $(CCFLAGS) $<

all:	$(PROGS)

clean:
	rm -f *~ *.o $(PROGS)

backup:	dist

dist:
	rm -f *~ *.o
	(d=`basename $$PWD` ; cd .. ; tar cfz $$d.tgz $$d)

cctl:	$(cctl)
	$(CC) $(cctl) $(LDFLAGS) -o $@

ts7200io.o:	ts7200io.c ts7200io.h

install:	$(PROGS)
	@for f in $(PROGS) $(DEMOS) ; do \
	 install -D --backup $$f $(INSDIR)/$$f; done


