
# Makefile for the SAN Kit examples.
#
# Usage:
#   cd ../SAN_SRC && make lib   (only needed once, or after editing the library)
#   cd ../examples && make      (builds every example in this directory)
#   ./01_hello_board            (run one)

SRC=	../SAN_SRC
LIB=	$(SRC)/libsan.a

CC=	gcc
CFLAGS=	-pedantic -Wall -O -I$(SRC)

SOURCES=	$(wildcard [0-9]*.c)
PROGRAMS=	$(SOURCES:.c=)

all:	$(LIB) $(PROGRAMS)

$(LIB):
	$(MAKE) -C $(SRC) lib

%:	%.c _common.h $(LIB)
	$(CC) $(CFLAGS) -o $@ $< $(LIB)

clean:
	rm -f $(PROGRAMS)

.PHONY:	all clean
