kvisc/vm/Makefile

33 lines
679 B
Makefile
Raw Normal View History

2019-06-05 12:53:09 +02:00
# The OS/K Team licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
all: k.exe
.PHONY: clean
.INTERMEDIATE: %.o
in_src = $(shell ls in/*.c)
pc_src = $(shell ls pc/*.c)
2019-06-05 12:54:54 +02:00
obj = pc/disd.o $(patsubst %.c,%.o,$(pc_src)) $(patsubst %.c,%.o,$(in_src))
2019-06-05 12:53:09 +02:00
FLAGS=-O2 -g -Wall -fno-builtin-log -I.
2019-06-05 12:54:54 +02:00
pc/disd.o: i_arch.h */*.h pc/decd.c
2019-06-05 12:53:09 +02:00
@cc $(FLAGS) -D_NEED_DISASM -c pc/decd.c -o $@
%.o: %.c i_arch.h */*.h $(src)
@cc $(FLAGS) -c $< -o $@
i_arch.h: in/INSTRS in/arch_i.py
@cd in && python3 arch_i.py
clean:
@rm -f */*.o in/arch_i.h
k.exe: i_arch.h $(obj)
@gcc -O2 -Wall $(obj) -o k.exe
@rm in/arch_i.h
@rm -f */*.o