Created
May 5, 2011 17:28
-
-
Save redacted/957467 to your computer and use it in GitHub Desktop.
One Make to rule them all...
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
# get platform | |
uname_ans=$(shell uname) | |
ifeq ($(uname_ans), Darwin) | |
# on a Mac, can use clang/llvm | |
# much better diagnostics, slightly slower code | |
cc=clang | |
else | |
# fall back to gcc | |
cc=gcc | |
endif | |
cflags=-Os | |
ldflags=-lm | |
sources= main.c anneal.c point_gen.c map_func.c | |
objects=$(sources:.c=.o) | |
executable=anneal | |
all: $(sources) $(executable) | |
$(executable): $(objects) | |
$(cc) $(ldflags) $(objects) -o $@ | |
.c.o: | |
$(cc) $(cflags) $< -c | |
$(objects): parameters.h | |
clean: | |
rm $(executable) $(objects) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment