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
543 B
Makefile
Raw Normal View History

LDLIBS := -lscterm -lm -lsccolor
2021-12-11 23:45:15 +01:00
BIN := $(shell basename $$(pwd))
SRCS := $(wildcard *.cpp)
OBJS := $(SRCS:.cpp=.o)
2024-09-11 16:42:54 +02:00
DEPS := $(SRCS:.cpp=.dep)
2021-12-11 23:45:15 +01:00
CXX ?= g++
2024-09-11 16:42:54 +02:00
CXXFLAGS += -Wshadow -Wall -Wpedantic -Wextra -Wno-unused-parameter
2024-10-30 11:16:28 +01:00
CXXFLAGS += -g3 -std=c++17
2021-12-11 23:45:15 +01:00
ifeq ($(DEBUG),1)
CXXFLAGS += -D DEBUG -O0
else
CXXFLAGS += -D NDEBUG -O3
endif
2024-09-11 16:42:54 +02:00
%.o: %.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.dep -c $<
2021-12-11 23:45:15 +01:00
2024-09-11 16:42:54 +02:00
%.dep: ;
2021-12-11 23:45:15 +01:00
2024-09-11 16:42:54 +02:00
$(BIN): $(OBJS)
2024-03-28 15:25:09 +01:00
$(CXX) $(LDFLAGS) -o $(BIN) $(OBJS) $(LDLIBS)
2021-12-11 23:45:15 +01:00
2024-09-11 16:42:54 +02:00
-include $(DEPS)
2021-12-11 23:45:15 +01:00
2024-09-11 16:42:54 +02:00
.PHONY: clean
2021-12-11 23:45:15 +01:00
clean:
2024-09-11 16:42:54 +02:00
rm -f $(OBJS) $(DEPS) $(BIN)