Created
June 12, 2018 12:46
-
-
Save emrahayanoglu/7088f3129b228ac53bdf9ab11cd77dc7 to your computer and use it in GitHub Desktop.
Makefile file for compiling multiple c++ files on the same folder
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
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