1PETSc.pc := $(PETSC_DIR)/$(PETSC_ARCH)/lib/pkgconfig/PETSc.pc 2CEED_DIR ?= ../.. 3ceed.pc := $(CEED_DIR)/lib/pkgconfig/ceed.pc 4 5CC := $(shell pkg-config --variable=ccompiler $(PETSc.pc) $(ceed.pc)) 6CFLAGS := -std=c99 $(shell pkg-config --variable=cflags_extra $(PETSc.pc)) $(shell pkg-config --cflags-only-other $(PETSc.pc)) 7CPPFLAGS := $(shell pkg-config --cflags-only-I $(PETSc.pc) $(ceed.pc)) 8LDFLAGS := $(shell pkg-config --libs-only-L --libs-only-other $(PETSc.pc) $(ceed.pc)) 9LDFLAGS += $(patsubst -L%, $(shell pkg-config --variable=ldflag_rpath $(PETSc.pc))%, $(shell pkg-config --libs-only-L $(PETSc.pc) $(ceed.pc))) 10LDLIBS := $(shell pkg-config --libs-only-l $(PETSc.pc) $(ceed.pc)) -lm 11 12bp.c := $(wildcard bp*.c) 13bp := $(bp.c:%.c=%) 14 15all: $(bp) okl-lib-cache 16 17print: 18 $(info CC : $(CC)) 19 $(info CFLAGS : $(CFLAGS)) 20 $(info CPPFLAGS: $(CPPFLAGS)) 21 $(info LDFLAGS : $(LDFLAGS)) 22 $(info LDLIBS : $(LDLIBS)) 23 24# okl-lib-cache depending on OCCA and INSTALL 25okl-lib-cache: 26# First test to see if libceed was compiled with OCCA 27ifneq ($(wildcard $(OCCA_DIR)/lib/libocca.*),) 28# Second test to see if '../..' is CEED_DIR 29ifneq ($(CEED_DIR),../..) 30okl-lib-cache: 31 $(OCCA_DIR)/bin/occa cache ceed $(abspath $(CEED_DIR)/lib/okl/*.okl) 32endif 33endif 34 35clean: 36 $(RM) $(bp) 37 38.PHONY: all print clean 39