-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
78 lines (57 loc) · 2.45 KB
/
Makefile
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# The location of the mesh library
#LIBMESH_DIR ?= ../../..
LIBMESH_DIR = /home/scratch/libmesh-libs/libmesh-0.7.3/libmesh
# include the library options determined by configure. This will
# set the variables INCLUDE and LIBS that we will need to build and
# link with the library.
include $(LIBMESH_DIR)/Make.common
###############################################################################
# File management. This is where the source, header, and object files are
# defined
#
# source files
srcfiles := $(wildcard *.C)
#
# object files
objects := $(patsubst %.C, %.$(obj-suffix), $(srcfiles))
###############################################################################
.PHONY: clean clobber distclean
###############################################################################
# Target:
# orginal Makefile target command
#target := ./systems_of_equations_ex1-$(METHOD)
#target with petsc stuff added
#target := ./systems_of_equations_ex1-$(METHOD) -pc_type bjacobi -sub_pc_type ilu -sub_pc_factor_levels 4 -sub_pc_factor_zeropivot 0 -ksp_right_pc --disable-perflog
target := ./systems_of_equations_ex1-$(METHOD)
all:: $(target)
# Production rules: how to make the target - depends on library configuration
$(target): $(objects)
@echo "Linking "$@"..."
@$(libmesh_CXX) $(libmesh_CPPFLAGS) $(libmesh_CXXFLAGS) $(objects) -o $@ $(libmesh_LIBS) $(libmesh_LDFLAGS)
# Useful rules.
clean:
@rm -f $(objects) *~
clobber:
@$(MAKE) clean
@rm -f $(target) out*.gmv
distclean:
@$(MAKE) clobber
@rm -f *.o *.g.o *.pg.o .depend
run: $(target)
@echo "***************************************************************"
@echo "* Running Example " $(LIBMESH_RUN) $(target) $(LIBMESH_OPTIONS)
@echo "***************************************************************"
@echo " "
@$(LIBMESH_RUN) $(target) $(LIBMESH_OPTIONS) #-start_in_debugger -on_error_attach_debugger
@echo " "
@echo "***************************************************************"
@echo "* Done Running Example " $(LIBMESH_RUN) $(target) $(LIBMESH_OPTIONS)
@echo "***************************************************************"
# include the dependency list
include .depend
#
# Dependencies
#
.depend: $(srcfiles) $(LIBMESH_DIR)/include/*/*.h
@$(perl) $(LIBMESH_DIR)/contrib/bin/make_dependencies.pl -I. $(foreach i, $(wildcard $(LIBMESH_DIR)/include/*), -I$(i)) "-S\$$(obj-suffix)" $(srcfiles) > .depend
###############################################################################