This repository has been archived on 2026-05-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
piquant/tests/Makefile
2016-03-27 13:20:36 -07:00

21 lines
444 B
Makefile

CFLAGS:=-ffreestanding -fno-builtin -I../src -ansi -Wall -Werror
%.o: %.c
gcc $(CFLAGS) -c -o $@ $<
for file in $$(cat $$(echo $@ | sed 's/\.o$$//').deps); do \
gcc $(CFLAGS) -c -o ./$${file}.o ../src/$$file.c ; \
done
%.elf: %.o
gcc $(CFLAGS) -o $@ $^ $$(cat $$(echo $@ | sed 's/\.elf$$//').deps | sed 's/$$/\.o/g')
all_targets:=$(shell ls *c | sed 's/\.c$$/\.elf/g')
all: $(all_targets)
.PHONY: clean
clean:
rm -f *o
rm -f *elf