Skip to content

Instantly share code, notes, and snippets.

@rawlik
Created December 13, 2014 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawlik/fdcde9507880ceb2f611 to your computer and use it in GitHub Desktop.
Save rawlik/fdcde9507880ceb2f611 to your computer and use it in GitHub Desktop.
a simple ROOT Makefile
CC=clang++
FLAGS= `root-config --cflags` -std=c++11
LINK_FLAGS= `root-config --glibs`
DEPS = breedSFC.h
PROGRAMS = playground tests
PROGRAMS_OBJS = $(foreach X,$(PROGRAMS),$(X).o)
OBJS = breedSFC.o
all: $(PROGRAMS)
# compile object files
%.o: %.cpp $(DEPS)
$(CC) $(FLAGS) -c -o $@ $<
# link each program
# a program depends on program.o and other objects
$(PROGRAMS): %: %.o $(OBJS)
$(CC) $(LINK_FLAGS) -o $@ $^
clean:
rm -f $(PROGRAMS) $(PROGRAMS_OBJS) $(OBJS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment