2019-05-16 19:59:14 +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
|
|
|
|
|
2019-05-29 16:57:22 +02:00
|
|
|
src = instrs/instrs.c decd.c main.c regs.c dump.c \
|
|
|
|
instrs/jumps.c except.c disd.c mem.c instrs/logic.c \
|
2019-05-30 13:25:30 +02:00
|
|
|
instrs/stack.c instrs/super.c instrs/arith.c log.c \
|
2019-05-30 18:31:50 +02:00
|
|
|
instrs/debug.c instrs/mov.c
|
2019-05-16 19:59:14 +02:00
|
|
|
|
|
|
|
obj = $(patsubst %.c,%.o,$(src))
|
|
|
|
|
2019-05-30 11:32:00 +02:00
|
|
|
CFLAGS=-O2 -g -Wall -fno-builtin-log
|
|
|
|
|
2019-05-16 20:09:20 +02:00
|
|
|
%.o: %.c i_arch.h *.h $(src)
|
2019-05-30 11:32:00 +02:00
|
|
|
@gcc $(CFLAGS) -c $< -o $@
|
2019-05-16 19:59:14 +02:00
|
|
|
|
2019-05-29 16:57:22 +02:00
|
|
|
i_arch.h: instrs/INSTRS instrs/arch_i.py
|
|
|
|
@cd instrs && python3 arch_i.py
|
2019-05-16 19:59:14 +02:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm *.o
|
|
|
|
|
2019-05-29 16:57:22 +02:00
|
|
|
k.exe: $(obj) i_arch.h
|
2019-05-16 20:09:20 +02:00
|
|
|
@gcc -O2 -Wall $(obj) -o k.exe
|
2019-05-29 16:57:22 +02:00
|
|
|
@rm instrs/arch_i.h
|
|
|
|
@rm *.o */*.o
|
2019-05-16 19:59:14 +02:00
|
|
|
|