Skip to content

Instantly share code, notes, and snippets.

@dai1741
Created December 30, 2011 13:55
Show Gist options
  • Save dai1741/1539958 to your computer and use it in GitHub Desktop.
Save dai1741/1539958 to your computer and use it in GitHub Desktop.
Eclipse CDTで競技プログラミングのコードを1プロジェクト内にまとめたうえで個別に実行できるようにするGNU Makefile
# ファイル構成:
# root
# |- src :*.cppが入っている
# |- bin :ここに*.exeが生成される
CXXFLAGS = -O2 -g -Wall -fmessage-length=0
CPPS = $(wildcard src/*.cpp)
OBJS = $(CPPS:.cpp=.o)
LIBS =
TARGET = $(CPPS:src/%.cpp=bin/%.exe)
#$(TARGET): $(OBJS)
# $(CXX) -g -o $(TARGET) $(OBJS) $(LIBS)
bin/%.exe : src/%.o
$(CXX) -g -o "$@" $< $(LIBS)
all: $(TARGET)
clean:
rm -f $(OBJS) $(wildcard bin/*.exe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment