website/_posts/cheri/code/Makefile

22 lines
471 B
Makefile
Raw Normal View History

2022-11-22 00:13:56 +00:00
CFLAGS += -Wall -g -fno-stack-protector -O0
2022-11-19 11:56:01 +00:00
CC ?= clang
PURECAP_CC ?= ~/cheri/output/sdk/utils/cheribsd-riscv64-purecap-clang
SOURCES := $(wildcard *.c)
OBJECTS := $(patsubst %.c, %, $(SOURCES))
OBJECTS_CHERIBSD := $(patsubst %.c, %-cheribsd, $(SOURCES))
all: all-host all-cheribsd
all-host: $(OBJECTS)
all-cheribsd: $(OBJECTS_CHERIBSD)
%: %.c
$(CC) $< $(CFLAGS) -o $@
%-cheribsd: %.c
$(PURECAP_CC) $< $(CFLAGS) -o $@
clean:
rm $(OBJECTS) $(OBJECTS_CHERIBSD)