#
# This Makefile builds 410 test suite
# Do not edit this file
#

include 410tests.mk

MAKE = make
CC = gcc
CFLAGS = -nostdinc -fno-strict-aliasing -fno-builtin -Wall -gstabs+ -Werror
LDFLAGS = -static --entry=_main -Ttext 1000000
LPATH = ../lib
INCLUDES = -I./ -I../inc -I../lib/inc
LIBS = -lthread -lmalloc -lstdio -lstdlib -lstring -lsyscall -lrand

PROGS = $(TPROGS)

.PHONY: all clean

all: ../410_tests.tgz

../410_tests.tgz: $(PROGS) 410tests.mk
	tar -zcvf ../410_tests.tgz shell init $(PROGS)

%.o: %.s
	$(CC) -c -o $(*F).o $(CFLAGS) $(INCLUDES) $(*F).s

%.o: %.c
	$(CC) -c -o $(*F).o $(CFLAGS) $(INCLUDES) $(*F).c

$(PROGS): %: %.o crt0.o 
	ld $(LDFLAGS) -o $@ crt0.o $<  -L$(LPATH) $(LIBS)

clean:
	rm -fr *.o *~ $(PROGS) *.d *.a ../410_tests.tgz
