1 | TEST_PROGRAMS = test_cloud_generator test_spartacus_math \ |
---|
2 | test_aerosol_optics_description test_random_number_generator \ |
---|
3 | test_fast_expm |
---|
4 | |
---|
5 | # In dependency order: |
---|
6 | SOURCES = ecrad_driver_read_input.F90 \ |
---|
7 | ecrad_driver_config.F90 |
---|
8 | |
---|
9 | OBJECTS := $(SOURCES:.F90=.o) |
---|
10 | EXECUTABLE = ../bin/ecrad |
---|
11 | IFS_EXECUTABLE = ../bin/ecrad_ifs |
---|
12 | IFS_BLOCKED_EXECUTABLE = ../bin/ecrad_ifs_blocked |
---|
13 | |
---|
14 | all: driver ifs_driver test_programs |
---|
15 | |
---|
16 | driver: $(EXECUTABLE) |
---|
17 | |
---|
18 | ifs_driver: $(IFS_EXECUTABLE) $(IFS_BLOCKED_EXECUTABLE) |
---|
19 | |
---|
20 | test_programs: $(TEST_PROGRAMS) |
---|
21 | |
---|
22 | # Link ecrad executable; add "-lifs" if you want to use the "satur" |
---|
23 | # routine in ecrad_driver.F90 |
---|
24 | $(EXECUTABLE): $(OBJECTS) ../lib/*.a ecrad_driver.o |
---|
25 | $(FC) $(FCFLAGS) ecrad_driver.o $(OBJECTS) $(LIBS) -o $(EXECUTABLE) |
---|
26 | |
---|
27 | $(IFS_EXECUTABLE): $(OBJECTS) ../lib/*.a ecrad_ifs_driver.o |
---|
28 | $(FC) $(FCFLAGS) ecrad_ifs_driver.o $(OBJECTS) -lifs $(LIBS) -o $(IFS_EXECUTABLE) |
---|
29 | |
---|
30 | $(IFS_BLOCKED_EXECUTABLE): $(OBJECTS) ../lib/*.a ecrad_ifs_driver_blocked.o |
---|
31 | $(FC) $(FCFLAGS) ifs_blocking.o ecrad_ifs_driver_blocked.o $(OBJECTS) -lifs $(LIBS) -o $(IFS_BLOCKED_EXECUTABLE) |
---|
32 | |
---|
33 | test_%: test_%.F90 ../lib/*.a |
---|
34 | $(FC) $(FCFLAGS) $< $(LIBS) -o $@ |
---|
35 | |
---|
36 | #$(TEST): $(TEST).F90 ../lib/*.a |
---|
37 | # $(FC) $(FCFLAGS) $(TEST).F90 $(LIBS) -o $(TEST) |
---|
38 | |
---|
39 | # Note that the dependence on mod files can mean that rerunning "make" |
---|
40 | # recreates the executable |
---|
41 | %.o: %.F90 ../lib/*.a |
---|
42 | $(FC) $(FCFLAGS) -c $< |
---|
43 | |
---|
44 | clean: |
---|
45 | rm -f *.o $(EXECUTABLE) $(IFS_EXECUTABLE) $(IFS_BLOCKED_EXECUTABLE) \ |
---|
46 | $(TEST_PROGRAMS) |
---|
47 | |
---|
48 | ecrad_driver.o: ecrad_driver_config.o ecrad_driver_read_input.o |
---|
49 | ecrad_ifs_driver.o: ecrad_driver_config.o ecrad_driver_read_input.o |
---|
50 | ecrad_ifs_driver_blocked.o: ecrad_driver_config.o ecrad_driver_read_input.o ifs_blocking.o |
---|
51 | ecrad_driver_read_input.o ifs_blocking.o: ecrad_driver_config.o |
---|
52 | |
---|
53 | .PHONY: driver ifs_driver test_programs all |
---|