Skip to content

Instantly share code, notes, and snippets.

@c4pt0r
Created December 31, 2011 09:28
Show Gist options
  • Save c4pt0r/1543523 to your computer and use it in GitHub Desktop.
Save c4pt0r/1543523 to your computer and use it in GitHub Desktop.
my makefile template
SRCS=main.cpp class.cpp
INCLUDE=
CC=g++
OUTPUT=main
FLAG_LINK=-g -lpthread -o $(OUTPUT)
FLAG_COMPILE=-g -c
OBJS=$(SRCS:.cpp=.o)
RM=rm
$(OUTPUT):$(OBJS)
$(CC) $(FLAG_LINK) $(OBJS)
@echo Write By ZhangEF
$(OBJS): %.o: %.cpp $(INCLUDE)
$(CC) $(FLAG_COMPILE) $<
.PHONY:clean
clean:
$(RM) $(OBJS) $(OUTPUT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment