Skip to content

Instantly share code, notes, and snippets.

@crakaC
Created October 29, 2012 07:16
Show Gist options
  • Save crakaC/3972085 to your computer and use it in GitHub Desktop.
Save crakaC/3972085 to your computer and use it in GitHub Desktop.
ディレクトリ内の.cppファイルからそれぞれの実行ファイルを生成
CC=g++
CFLAGS=-Wall
.SUFFIXES = .cpp
objs:=$(wildcard *.cpp)
targets:=$(objs:.cpp=)
.PHONY:all
all: $(targets)
.cpp:
$(CC) $(CFLAGS) -o $* $<
.PHONY: clean
clean:
$(RM) *~ $(targets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment