Skip to content

Instantly share code, notes, and snippets.

@fa7ad
Created Oct 4, 2017
Embed
What would you like to do?
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