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
|
|
|
|
|
2019-06-05 19:31:48 +02:00
|
|
|
dv_src = $(shell ls dv/*.c)
|
2019-06-05 12:53:09 +02:00
|
|
|
in_src = $(shell ls in/*.c)
|
|
|
|
pc_src = $(shell ls pc/*.c)
|
|
|
|
|
2019-06-05 19:31:48 +02:00
|
|
|
obj = pc/disd.o
|
|
|
|
obj += $(patsubst %.c,%.o,$(dv_src))
|
|
|
|
obj += $(patsubst %.c,%.o,$(in_src))
|
|
|
|
obj += $(patsubst %.c,%.o,$(pc_src))
|
2019-06-05 12:53:09 +02:00
|
|
|
|
|
|
|
FLAGS=-O2 -g -Wall -fno-builtin-log -I.
|
|
|
|
|
2019-06-05 19:31:48 +02:00
|
|
|
pc/disd.o: in/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 $@
|
|
|
|
|
2019-06-05 19:31:48 +02:00
|
|
|
%.o: %.c in/i_arch.h */*.h $(src)
|
2019-06-05 12:53:09 +02:00
|
|
|
@cc $(FLAGS) -c $< -o $@
|
|
|
|
|
2019-06-05 19:31:48 +02:00
|
|
|
in/i_arch.h: in/INSTRS in/arch_i.py
|
2019-06-05 12:53:09 +02:00
|
|
|
@cd in && python3 arch_i.py
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -f */*.o in/arch_i.h
|
|
|
|
|
2019-06-05 19:31:48 +02:00
|
|
|
k.exe: in/i_arch.h $(obj)
|
2019-06-05 12:53:09 +02:00
|
|
|
@gcc -O2 -Wall $(obj) -o k.exe
|
|
|
|
@rm in/arch_i.h
|
|
|
|
@rm -f */*.o
|
|
|
|
|