Update Makefile to be more like AVM Makefile
Less colours more information, easier to decode.
This commit is contained in:
22
Makefile
22
Makefile
@@ -1,16 +1,19 @@
|
||||
CPP=g++
|
||||
|
||||
VERBOSE=0
|
||||
RELEASE=1
|
||||
|
||||
GENERAL-FLAGS=-Wall -Wextra -Werror -Wswitch-enum -std=c++17 -I$(shell pwd) -I$(shell pwd)/avm
|
||||
DEBUG-FLAGS=-ggdb -fsanitize=address
|
||||
RELEASE-FLAGS=-O3
|
||||
CPPFLAGS:=$(GENERAL-FLAGS) -std=c++17 $(DEBUG-FLAGS) -D VERBOSE=$(VERBOSE)
|
||||
|
||||
ifeq ($(RELEASE),1)
|
||||
CPPFLAGS:=$(GENERAL-FLAGS) -pedantic $(RELEASE-FLAGS) -DVERBOSE=$(VERBOSE)
|
||||
else
|
||||
CPPFLAGS:=$(GENERAL-FLAGS) -pedantic $(DEBUG-FLAGS) -DVERBOSE=$(VERBOSE)
|
||||
endif
|
||||
|
||||
LIBS=-lm
|
||||
DIST=build
|
||||
TERM_YELLOW:=$(shell echo -e "\e[0;33m")
|
||||
TERM_GREEN:=$(shell echo -e "\e[0;32m")
|
||||
TERM_RESET:=$(shell echo -e "\e[0;0m")
|
||||
|
||||
# Setup variables for source code, output, etc
|
||||
## ASSEMBLY setup
|
||||
@@ -46,17 +49,14 @@ examples: $(EXAMPLES)
|
||||
# Recipes
|
||||
## ASSEMBLY Recipes
|
||||
$(OUT): $(AVM_OBJECTS) $(OBJECTS) $(DIST)/main.o
|
||||
@$(CPP) $(CPPFLAGS) $^ -o $@ $(LIBS)
|
||||
@echo "$(TERM_GREEN)$@$(TERM_RESET): $^"
|
||||
$(CPP) $(CPPFLAGS) $^ -o $@ $(LIBS)
|
||||
|
||||
$(DIST)/%.o: $(SRC)/%.cpp | $(DIST) $(DEPDIR)/asm
|
||||
@$(CPP) $(CPPFLAGS) $(DEPFLAGS) $(DEPDIR)/asm/$*.d -c $< -o $@ $(LIBS)
|
||||
@echo "$(TERM_YELLOW)$@$(TERM_RESET): $<"
|
||||
$(CPP) $(CPPFLAGS) $(DEPFLAGS) $(DEPDIR)/asm/$*.d -c $< -o $@ $(LIBS)
|
||||
|
||||
## EXAMPLES recipes
|
||||
$(EXAMPLES_DIST)/%.out: $(EXAMPLES_SRC)/%.asm $(OUT) | $(EXAMPLES_DIST)
|
||||
@$(OUT) $< $@
|
||||
@echo "$(TERM_GREEN)$@$(TERM_RESET): $<"
|
||||
$(OUT) $< $@
|
||||
|
||||
.PHONY: run-examples
|
||||
run-examples: $(EXAMPLES)
|
||||
|
||||
Reference in New Issue
Block a user