-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·38 lines (33 loc) · 893 Bytes
/
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
CC = gcc
#C compiler
CFLAGS = -O3 -pg -std=c99 -o
#C compiler options
SRC = ./src
#Directory of sources
INCLUDE = -I $(SRC)/include
#Inclued folder
LIBS = -lgsl -lgslcblas -lm
RM = rm -vf
#Delete command
HEAD = finite_volume meshing file_io Riemann_solver tools
#Name of header files or subdirectories
SOURCE = hydrocode
#Name of the main source
all : modules
@echo "**********Generate executable file***********"
$(CC) $(CFLAGS) $(SRC)/$(SOURCE).out $(SRC)/$(SOURCE).c $(addsuffix /*.a,$(addprefix $(SRC)/,$(HEAD))) $(INCLUDE) $(LIBS)
.PHONYP:all
modules:
#Enter each subdirectory
#Call the Makefile in the subdirectory
@for n in $(HEAD); do \
( make -f Makefile.sub --directory=$(SRC)/$$n ) \
done;
.PHONYP:modules
clean:
#Clean in the subdirectory
@$(RM) $(SRC)/$(SOURCE).o
@for n in $(HEAD); do \
( make -f Makefile.sub --directory=$(SRC)/$$n clean ) \
done;
.PHONYP:clean