# Makefile for test drivers in this directory # $Header$ # # We want to compile standalone test drivers which may use other flesh # routines (eg Util_*()), so we have to link with -lCactus. That means # we also need to link against a bunch of other libraries which -lCactus # uses. The current "solution" is to find a configuration (just the first # one in the configs directory) and grab the libraries it specifies. # This is a kludge, but it seems to work fairly well... # # defaults -- override from command line as desired CC := gcc CFLAGS := -Wall -W -Wno-unused -Wshadow -Winline -Wpointer-arith \ -Wbad-function-cast -Wcast-align -Wcast-qual \ -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations EXTRA_CFLAGS := CONFIG_DATA_DIR := $(firstword $(wildcard ../../configs/*/config-data)) LIB_DIR := $(dir $(CONFIG_DATA_DIR))lib MPI_LIB_DIRS := $(shell egrep '^MPI_LIB_DIRS' $(CONFIG_DATA_DIR)/make.extra.defn | sed -e 's/.*=//') MPI_LIBS := $(shell egrep '^MPI_LIBS' $(CONFIG_DATA_DIR)/make.extra.defn | sed -e 's/.*=//') # build outside cactus .PHONY : test-table-standalone test-table-standalone : $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -g \ -I. -I../include -I$(CONFIG_DATA_DIR) -L$(LIB_DIR) \ -DUTIL_TABLE_TEST \ -o test_Table \ Table.c \ $(LIB_DIR)/../datestamp.o -lCactus -lCactusBindings \ $(addprefix -L, $(MPI_LIB_DIRS)) $(addprefix -l, $(MPI_LIBS)) \ -lm