Skip to content

Commit

Permalink
GMAKEFILE: move print target to base gmakefile
Browse files Browse the repository at this point in the history
allow TESTS log file to be customizable
  • Loading branch information
stefanozampini committed Dec 3, 2018
1 parent add6df9 commit 37ed16b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 6 additions & 2 deletions gmakefile
Expand Up @@ -194,11 +194,15 @@ $(OBJDIR)/sys/classes/bag/f2003-src/fsrc/bagenum.o : $(OBJDIR)/sys/f90-mod/pets
# all sources should get recompiled when petscvariables changes (i.e when configure is rerun or when petscvariables is manually edited.)
$(srcs.o) : $(petscvariables)

.PHONY: clean all
.PHONY: clean all print

clean:
clean:
${RM} -r $(OBJDIR) $(LIBDIR)/libpetsc* $(MODDIR)/petsc*.mod $(MPIUNI_MOD) $(generated)

# make print VAR=the-variable
print:
@echo $($(VAR))

allobj.d := $(srcs.o:%.o=%.d)
# Tell make that allobj.d are all up to date. Without this, the include
# below has quadratic complexity, taking more than one second for a
Expand Down
12 changes: 3 additions & 9 deletions gmakefile.test
@@ -1,6 +1,6 @@
# -*- mode: makefile-gmake -*-

CONFIGDIR := config
CONFIGDIR := $(PETSC_DIR)/config

# TESTSRCDIR is always relative to gmakefile.test
# This must be before includes
Expand All @@ -12,7 +12,7 @@ include $(PETSC_DIR)/lib/petsc/conf/variables

TESTDIR ?= ./$(PETSC_ARCH)/tests
MODDIR := $(PETSC_DIR)/$(PETSC_ARCH)/include
TESTLOGFILE = $(TESTDIR)/examples_$(PETSC_ARCH).log
TESTLOGFILE ?= $(TESTDIR)/examples_$(PETSC_ARCH).log
EXAMPLESDIR := $(TESTSRCDIR)

pkgs := sys vec mat dm ksp snes ts tao
Expand Down Expand Up @@ -75,8 +75,6 @@ ifdef TIMEOUT
TESTFLAGS += -t $(TIMEOUT) # Override the default timeout
endif



$(generatedtest) : $(petscconf) $(petscvariables) $(CONFIGDIR)/gmakegentest.py $(TESTDIR)/.DIR | $$(@D)/.DIR
$(PYTHON) $(CONFIGDIR)/gmakegentest.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --testdir=$(TESTDIR)

Expand Down Expand Up @@ -215,17 +213,13 @@ $(testsrcs.o) : $(petscvariables)
.SUFFIXES: # Clear .SUFFIXES because we don't use implicit rules
.DELETE_ON_ERROR: # Delete likely-corrupt target file if rule fails

.PHONY: clean cleantest all print
.PHONY: clean cleantest all

cleantest:
${RM} -r $(TESTDIR) $(generatedtest)

clean: cleantest

# make print VAR=the-variable
print:
@echo $($(VAR))

alltest.d := $(testsrcs.o:%.o=%.d)
# Tell make that alltest.d are all up to date. Without this, the include
# below has quadratic complexity, taking more than one second for a
Expand Down

0 comments on commit 37ed16b

Please sign in to comment.