Skip to content

Instantly share code, notes, and snippets.

@emrahayanoglu
Created June 12, 2018 12:46
Show Gist options
  • Save emrahayanoglu/7088f3129b228ac53bdf9ab11cd77dc7 to your computer and use it in GitHub Desktop.
Save emrahayanoglu/7088f3129b228ac53bdf9ab11cd77dc7 to your computer and use it in GitHub Desktop.
Makefile file for compiling multiple c++ files on the same folder
CC := g++
CFLAGS := -Wall -g -std=c++11
all: $(patsubst %.cpp, %.out, $(wildcard *.cpp))
%.out: %.cpp Makefile
$(CC) $(CFLAGS) $< -o $(@:.out=)
clean: $(patsubst %.cpp, %.clean, $(wildcard *.cpp))
%.clean:
rm -f $(@:.clean=)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment