Skip to content

Instantly share code, notes, and snippets.

@shogo82148
Created May 23, 2012 03:04
Show Gist options
  • Save shogo82148/2773035 to your computer and use it in GitHub Desktop.
Save shogo82148/2773035 to your computer and use it in GitHub Desktop.
Makefileのテンプレート
TARGET = target
SOURCES = main.cpp
CXX = g++
CXXFLAGS = -O3 -Wall -W
LDFLAGS =
INCLUDES =
LIBS =
OBJECTS = $(SOURCES:.cpp=.o)
LFLAG =
.SUFFIXES: .cpp .o
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCLUDES) -o $@ $<
$(TARGET): $(OBJECTS)
$(CXX) $(LFLAG) $(CXXFLAGS) $(LIBS) -o $@ $^
.PHONY: all clean
all: $(TARGET)
clean:
-rm -f $(OBJECTS) $(TARGET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment