Created
October 4, 2017 13:08
-
-
Save fa7ad/03a273925c212ad88fcc883c8222ba1b to your computer and use it in GitHub Desktop.
A simple makefile for programming practice
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
appname := myapp | |
CXX := g++ | |
CXXFLAGS := -Wall -g | |
srcfiles := $(wildcard *.cpp) | |
objects := $(srcfiles:.cpp=.o) | |
all: $(appname) | |
$(appname): $(objects) | |
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(appname) $(objects) $(LDLIBS) | |
.PHONY: clean | |
clean: | |
rm -f $(objects) $(appname) | |
run: | |
./$(appname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment