Skip to content
Snippets Groups Projects
Unverified Commit 885288bc authored by undef's avatar undef Committed by Clayton Craft
Browse files

Allow verbose builds in Makefile (MR 100)

The makefile now checks a `V` environmental variable. If set to 1, make
will print all commands and arguments used in building OSK-SDL.

This is useful in both debugging, and packaging, allowing automated
checks for hardening flags.
parent 9b197815
No related branches found
No related tags found
1 merge request!100Allow verbose builds in Makefile
Pipeline #186328 passed
......@@ -15,15 +15,23 @@ OBJ_DIR := obj
SOURCES := ${wildcard $(SRC_DIR)/*.cpp}
OBJECTS := $(SOURCES:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
ifeq ("$(V)", "1")
Q :=
E := @true
else
Q := @
E := @echo
endif
all: directories $(BIN_DIR)/$(TARGET)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
@echo CC $<
@$(CXX) -c -o $@ $< $(CXXFLAGS)
$(E) CC $<
$(Q)$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)
$(BIN_DIR)/$(TARGET): $(OBJECTS)
@echo LD $@
@$(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) $(LIBS)
$(E) LD $<
$(Q)$(CXX) -o $@ $^ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBS)
.PHONY: clean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment