#
# ARM-uC/OS 
#
# File: Makefile
#
# Assumes armcc/armasm/armlink are in the PATH. 
#
# Build uC/OS, example1 and the ping example for the
# VLSI's ARM-based PID development board.
#

CFLAGS= -c -li -zpq8 -zps1	# -zps1 avoids stack checking calls
				#
				# the PID board uses the ARM configured
				# little endian
				#
				# define PIDLEDS to see the PID leds
				# counting the seconds

AFLAGS= -li -apcs 3/32bit	# use apcs 32 bit and little endian

# override standard macros
COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) 
LINK.o=$(LD) $(LDFLAGS) $@ $<
COMPILE.s=$(AS) $(AFLAGS)

AS = armasm
CC = armcc
LD = armlink

OBJS = subr.o os.o pid.o crt.o

all:	example1 ping

example1:	example1.o $(OBJS)
	armlink -o $@ example1.o $(OBJS)

example1.o:	example1.c

ping:	ping.o $(OBJS)
	armlink -o $@ ping.o $(OBJS)

ping.o:	ping.c

crt.o:	crt.s crt.h

os.o:	os.c pid.h ucos.h osdefs.h

pid.o:	pid.c pid.h ucos.h osdefs.h
	
subr.o:	subr.s
