Last active
May 5, 2025 16:58
-
-
Save iKunalChhabra/b15545a493b6d81ca2e4c2d99cb1a504 to your computer and use it in GitHub Desktop.
Simple c++ makefile
This file contains hidden or 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
| # Makefile | |
| # '@' added to suppress printing commands on shell | |
| # Variables | |
| CXX = g++ | |
| CXXFLAGS = -O3 | |
| TARGET = main | |
| SRC = main.cpp | |
| # Default target | |
| all: build run | |
| # Build step | |
| build: $(SRC) | |
| @$(CXX) $(CXXFLAGS) -o $(TARGET) $(SRC) | |
| # Run step | |
| run: $(TARGET) | |
| @./$(TARGET) | |
| # Clean step | |
| clean: | |
| @rm -f $(TARGET) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment