Created
August 27, 2014 13:46
-
-
Save hustlijian/7f4de6c7430d2bc2c208 to your computer and use it in GitHub Desktop.
simple c++ makefile
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
CXXFLAGS=-Wall -g | |
CC=g++ | |
LDFLAGS=-L/usr/lib | |
LDLIBS=-lm | |
all: main | |
main: main.o expression.o | |
clean: | |
rm -f main *.o |
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
# http://stackoverflow.com/questions/2481269/how-to-make-simple-c-makefile | |
CC=gcc | |
CXX=g++ | |
RM=rm -f | |
CPPFLAGS=-g $(shell root-config --cflags) | |
LDFLAGS=-g $(shell root-config --ldflags) | |
LDLIBS=$(shell root-config --libs) | |
SRCS=tool.cc support.cc | |
OBJS=$(subst .cc,.o,$(SRCS)) | |
all: tool | |
tool: $(OBJS) | |
g++ $(LDFLAGS) -o tool $(OBJS) $(LDLIBS) | |
depend: .depend | |
.depend: $(SRCS) | |
rm -f ./.depend | |
$(CXX) $(CPPFLAGS) -MM $^>>./.depend; | |
clean: | |
$(RM) $(OBJS) | |
dist-clean: clean | |
$(RM) *~ .dependtool | |
include .depend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment