Last active
June 14, 2024 15:07
-
-
Save nightuser/035b204186ae8a739691f99492edd184 to your computer and use it in GitHub Desktop.
Simple C++ Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BIN = main | |
CXXFLAGS = -Wall -Wextra -std=c++20 | |
CPPFLAGS = -MMD | |
SRCS = $(wildcard *.cc) | |
OBJS = $(SRCS:.cc=.o) | |
DEPS = $(SRCS:.cc=.d) | |
LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH) | |
.PHONY: all | |
all: $(BIN) | |
.PHONY: clean | |
clean: | |
$(RM) $(BIN) *.o *.d | |
$(BIN): $(OBJS) | |
-include $(DEPS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment