1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
# Part of SuperNOVAS
#
# Build exammple programs
#
# Author: Attila Kovacs
# Use the definitions project definitions
include ../config.mk
EXAMPLES = example-star example-high-z example-orbital example-time example-rise-set
CPPFLAGS += -I../include
LDFLAGS += -L../$(LIB) -lsupernovas
ifeq ($(CALCEPH_SUPPORT),1)
EXAMPLES += example-calceph
LDFLAGS += -lsolsys-calceph -lcalceph
endif
ifeq ($(CSPICE_SUPPORT),1)
EXAMPLES += example-cspice
LDFLAGS += -lsolsys-cspice -lcspice
endif
.PHONY: all
all: $(EXAMPLES)
# Static code analysis using 'cppcheck'
.PHONY: analyze
analyze:
@echo " [analyze]"
@cppcheck $(CPPFLAGS) $(CHECKOPTS) .
.PHONY: clean
clean:
.PHONY: distclean
distclean:
rm -f $(EXAMPLES)
example-%: example-%.c
$(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $< $(LDFLAGS)
.PHONY: help
help:
@echo
@echo "Syntax: make [target]"
@echo
@echo "The following targets are available:"
@echo
@echo " all (default) Build all example programs."
@echo " analyze Runs 'cppcheck' static analysis tool on sources."
@echo " clean Removes intermediate products."
@echo " distclean Deletes all generated files."
@echo
|