Skip to content

Instantly share code, notes, and snippets.

@fa7ad
Created October 4, 2017 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fa7ad/03a273925c212ad88fcc883c8222ba1b to your computer and use it in GitHub Desktop.
Save fa7ad/03a273925c212ad88fcc883c8222ba1b to your computer and use it in GitHub Desktop.
A simple makefile for programming practice
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