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.
|
|
|
|
|
|
|
|
.PHONY: clean
|
2019-06-13 17:51:49 +02:00
|
|
|
|
|
|
|
verbose ?= yes
|
|
|
|
OBJDIR = ob
|
2019-06-21 22:19:55 +02:00
|
|
|
|
2019-07-11 18:34:21 +02:00
|
|
|
FLAGS=-O2 -Wall -fno-builtin-log -I. -Werror=implicit-function-declaration
|
2019-06-05 12:53:09 +02:00
|
|
|
|
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-07-04 20:33:49 +02:00
|
|
|
obj = $(patsubst %.c,$(OBJDIR)/%.o,$(pc_src))
|
|
|
|
obj += $(patsubst %.c,$(OBJDIR)/%.o,$(dv_src))
|
2019-06-13 17:51:49 +02:00
|
|
|
obj += $(patsubst %.c,$(OBJDIR)/%.o,$(in_src))
|
2019-06-05 12:53:09 +02:00
|
|
|
|
2019-07-04 20:33:49 +02:00
|
|
|
dep = $(patsubst %.c,$(OBJDIR)/%.d,$(pc_src))
|
|
|
|
dep += $(patsubst %.c,$(OBJDIR)/%.d,$(dv_src))
|
2019-06-13 17:51:49 +02:00
|
|
|
dep += $(patsubst %.c,$(OBJDIR)/%.d,$(in_src))
|
|
|
|
|
|
|
|
# Color codes
|
|
|
|
CL='\033[0;32m'
|
|
|
|
CL2='\033[1;36m'
|
|
|
|
CL3='\033[0m'
|
|
|
|
NC='\033[1;37m'
|
|
|
|
|
2019-06-26 21:25:59 +02:00
|
|
|
KEXE=../fs/kvisc.exe
|
|
|
|
|
|
|
|
all: $(KEXE)
|
2019-06-05 12:53:09 +02:00
|
|
|
|
2019-06-13 17:51:49 +02:00
|
|
|
-include $(dep)
|
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.c
|
|
|
|
@mkdir -p $(shell dirname $@)
|
2019-06-05 12:53:09 +02:00
|
|
|
@cc $(FLAGS) -c $< -o $@
|
2019-06-13 23:12:11 +02:00
|
|
|
@if [ $(verbose) = "yes" ]; then \
|
2019-06-13 22:52:10 +02:00
|
|
|
echo ${CL2}[$@] ${CL}object file generated.${CL3};\
|
2019-06-13 17:51:49 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
$(OBJDIR)/%.d: %.c
|
|
|
|
@mkdir -p $(shell dirname $@)
|
|
|
|
@cc -I. -MM -MT $(@:%.d=%.o) -MF $@ $<
|
2019-06-21 22:19:55 +02:00
|
|
|
# @if [ $(verbose) = "yes" ]; then \
|
|
|
|
# echo ${CL2}[$@] ${CL}dependencies generated.${CL3};\
|
|
|
|
# fi
|
2019-06-05 12:53:09 +02:00
|
|
|
|
2019-07-18 22:49:31 +02:00
|
|
|
ob/instrs.lst: in/arch_i.py
|
2019-06-05 12:53:09 +02:00
|
|
|
@cd in && python3 arch_i.py
|
|
|
|
|
|
|
|
clean:
|
2019-07-18 22:49:31 +02:00
|
|
|
@rm -f $(OBJDIR)/*/*.o ob/arch_i.h ob/instrs.lst
|
2019-06-13 17:51:49 +02:00
|
|
|
@rm -f $(OBJDIR)/*/*.d
|
2019-06-05 12:53:09 +02:00
|
|
|
|
2019-07-18 22:49:31 +02:00
|
|
|
$(KEXE): ob/instrs.lst $(obj)
|
2019-06-26 21:25:59 +02:00
|
|
|
@gcc -O2 -lSDL2 -lSDL2_ttf -Wall $(obj) -o $(KEXE)
|
2019-06-13 17:51:49 +02:00
|
|
|
@echo ${CL2}[$@] ${CL}made successfully.${CL3}
|
2019-06-13 22:52:10 +02:00
|
|
|
|