This repository has been archived on 2024-12-13. You can view files and clone it, but cannot push or open issues or pull requests.
progress/Makefile

32 lines
549 B
Makefile

LDLIBS := -lscterm -lm -lscscreensaver
BIN := $(shell basename $$(pwd))
SRCS := $(wildcard *.cpp)
OBJS := $(SRCS:.cpp=.o)
DEPS := $(SRCS:.cpp=.dep)
CXX ?= g++
CXXFLAGS += -Wshadow -Wall -Wpedantic -Wextra -Wno-unused-parameter
CXXFLAGS += -g3 -std=c++17
ifeq ($(DEBUG),1)
CXXFLAGS += -D DEBUG -O0
else
CXXFLAGS += -D NDEBUG -O3
endif
%.o: %.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.dep -c $<
%.dep: ;
$(BIN): $(OBJS)
$(CXX) $(LDFLAGS) -o $(BIN) $(OBJS) $(LDLIBS)
-include $(DEPS)
.PHONY: clean
clean:
rm -f $(OBJS) $(DEPS) $(BIN)