Skip to content

Instantly share code, notes, and snippets.

@nightuser
Last active June 14, 2024 15:07
Show Gist options
  • Save nightuser/035b204186ae8a739691f99492edd184 to your computer and use it in GitHub Desktop.
Save nightuser/035b204186ae8a739691f99492edd184 to your computer and use it in GitHub Desktop.
Simple C++ Makefile
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