#
# 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)

all: $(PROGS)
	cp -f shell $(PROGS) ../temp

%.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 user_apps.c
