#
# Make file for adio
# cli program to read and/or set bits on the data lines of the DIO header
# of the TS-7200 ARM SBC, and the ADC Channels if ADC option fitted.
# 
# 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		= adio

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

adio		= adio.o ts7200io.o

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

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

all:	$(PROGS)

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

backup:	dist

dist:	distclean
	(d=`basename $$PWD` ; cd .. ; tar cfz $$d.tgz $$d)

distclean:
	rm -f *~ *.o

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

ts7200io.o:	ts7200io.c ts7200io.h

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


