26 lines
528 B
Makefile
26 lines
528 B
Makefile
JC ?= jasminc
|
|
CC ?= gcc
|
|
MAKE ?= make
|
|
|
|
JASMIN_ARGS = -protect-calls -return-address-kind=mmx
|
|
|
|
.PHONY: clean run
|
|
|
|
all: build
|
|
@true
|
|
|
|
build: build/agent.o
|
|
ar -crs build/libagent.a build/agent.o
|
|
|
|
build/%.o: build/%.S
|
|
$(CC) $< -c -o $@
|
|
|
|
clean:
|
|
rm build/* 2> /dev/null || true
|
|
$(MAKE) -C syscall clean
|
|
|
|
build/%.S: src/%.jazz
|
|
$(JC) $(JASMIN_ARGS) $< -o $@
|
|
# remove the remaining ret calls to make sure that we don't execute any return. Those returns should not be called anyways due to the infinit loop
|
|
sed -i 's/ret/hlt/g' $@
|