1 | #------------------------------------------------------------------------------ |
---|
2 | # Make rules for compiling source code files. |
---|
3 | # |
---|
4 | # This file is intended for use in a Makefile via the include directive, e.g. |
---|
5 | # |
---|
6 | # include $(BUILD_DIR)/compile_rules.mk |
---|
7 | # |
---|
8 | # It may also be include by other rule files in this directory. |
---|
9 | # |
---|
10 | # Copyright (C) 2001, WSI Corporation |
---|
11 | #------------------------------------------------------------------------------ |
---|
12 | # |
---|
13 | # For portability, use the Bourne shell within Makefiles. |
---|
14 | # There have been problems using the C-shell under Linux. |
---|
15 | # |
---|
16 | SHELL=/bin/sh |
---|
17 | |
---|
18 | # |
---|
19 | # Define all the extensions and include directories we will handle in the |
---|
20 | # compile rules. Currently it is just C and C++. |
---|
21 | # |
---|
22 | SRC_EXTENSIONS=.C .c .cpp .cxx .F90 .F .f90 |
---|
23 | |
---|
24 | # |
---|
25 | # RULES for compilation of C and C++ code |
---|
26 | # |
---|
27 | .SUFFIXES: .c .C .cpp .cxx .F90 .F .f90 |
---|
28 | .C.o: |
---|
29 | $(CXX) $(SYS_CXX_INCLUDES) $(SYS_C_INCLUDES) $(CXX_INCLUDES) $(CXXFLAGS) $(SYS_DEFINES) $(DEBUG) -c $< |
---|
30 | .c.o: |
---|
31 | $(CC) $(SYS_C_INCLUDES) $(C_INCLUDES) $(CFLAGS) $(SYS_DEFINES) $(DEBUG) -c $< |
---|
32 | .cxx.o: |
---|
33 | $(CXX) $(SYS_CXX_INCLUDES) $(SYS_C_INCLUDES) $(CXX_INCLUDES) $(CXXFLAGS) $(SYS_DEFINES) $(DEBUG) -c $< |
---|
34 | .cpp.o: |
---|
35 | $(CXX) $(SYS_CXX_INCLUDES) $(SYS_C_INCLUDES) $(CXX_INCLUDES) $(CXXFLAGS) $(SYS_DEFINES) $(DEBUG) -c $< |
---|
36 | |
---|
37 | .F90.o: |
---|
38 | $(FC) $(SYS_F_INCLUDES) $(F_INCLUDES) $(FCFLAGS) $(SYS_DEFINES) $(DEBUG) $(FORMAT) -c $< |
---|
39 | |
---|
40 | .F.o: |
---|
41 | $(RM) $@ |
---|
42 | $(CPP) $(CPPFLAGS) $(TRADFLAG) $(SYS_F_INCLUDES) $(F_INCLUDES) $*.F > $*.f90 |
---|
43 | $(FC) $(SYS_F_INCLUDES) $(FCSUFFIX) $(F_INCLUDES) $(FCFLAGS) $(SYS_DEFINES) $(DEBUG) $(FORMAT) -c $*.f90 |
---|
44 | |
---|
45 | .f90.o: |
---|
46 | $(FC) $(SYS_F_INCLUDES) $(F_INCLUDES) $(FCFLAGS) $(SYS_DEFINES) $(DEBUG) $(FORMAT) -c $< |
---|