# Makefile # (C) 2009 Philip Endecott # See http://chezphil.org/libmagdev/ # # Distributed under the Boost Software License, Version 1.0. # See accompanying file LICENSE. all: libmagdev.a magdev src/models.c src/params.c src/diffs.c: data/IGRF10.dat cd src; ../tools/mk_tables.sh < ../data/IGRF10.dat > params.c libmagdev.o: src/libmagdev.c src/models.c src/params.c src/diffs.c $(CC) $(CFLAGS) $(INCLUDES) -W -Wall --std=gnu99 -O -I./include -c src/libmagdev.c libmagdev.a: libmagdev.o $(AR) ruv $@ $^ magdev.o: src/magdev.c $(CC) $(CFLAGS) $(INCLUDES) -W -Wall --std=c99 -O -I./include -c src/magdev.c magdev: magdev.o libmagdev.a $(CC) -o $@ $^ -lm install: install libmagdev.a /usr/local/lib install magdev /usr/local/bin install include/libmagdev.h /usr/local/include clean: FORCE rm libmagdev.o libmagdev.a magdev.o magdev FORCE: .PHONY: FORCE clean install all