valid-utf8/Makefile

32 lines
533 B
Makefile
Raw Normal View History

LDLIBS := -lscstring
PROJ := $(shell basename $$(pwd))
2019-09-21 14:04:05 +02:00
SRCS := $(wildcard *.cpp)
OBJS := $(SRCS:.cpp=.o)
DEPS := $(SRCS:.cpp=.dep)
2019-09-21 14:04:05 +02:00
CXX ?= g++
CXXFLAGS += -Wshadow -Wall -Wpedantic -Wextra -Wno-unused-parameter
CXXFLAGS += -g3 -std=c++20
2019-09-21 14:04:05 +02:00
ifeq ($(DEBUG),1)
CXXFLAGS += -DDEBUG -O0
2019-09-21 14:04:05 +02:00
else
CXXFLAGS += -DNDEBUG -O3
2019-09-21 14:04:05 +02:00
endif
%.o: %.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.dep -c $<
2019-09-21 14:04:05 +02:00
%.dep: ;
2019-09-21 14:04:05 +02:00
$(PROJ): $(OBJS)
$(CXX) $(LDFLAGS) -o $(PROJ) $(OBJS) $(LDLIBS)
2019-09-21 14:04:05 +02:00
-include $(DEPS)
2019-09-21 14:04:05 +02:00
.PHONY: clean
2019-09-21 14:04:05 +02:00
clean:
rm -f $(OBJS) $(DEPS) $(PROJ)