ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/Rules.mk
Revision: 1.6
Committed: Wed Sep 14 15:59:13 2022 UTC (12 months, 1 week ago) by arta
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +9 -9 lines
Log Message:
Modifies make system to make it compatible with both the new git-repo structure
and the old cvs structure (commit 1)

File Contents

# Content
1 # Note: this design uses target-specific flags, because it's the only
2 # way to get the value of a variable that's different for each
3 # subdirectory, $(d), into the build recipes. Once you go that way,
4 # you can as well use the feature to specify (extra) objects and
5 # libraries to be linked or archived.
6
7
8 # Standard stuff
9
10 .SUFFIXES:
11 .SUFFIXES: .c .o
12
13 all: targets
14
15 # Subdirectories, in random order
16
17 dir := base
18 -include $(SRCDIR)/$(dir)/Rules.mk
19
20 dir := proj
21 -include $(SRCDIR)/$(LOCALIZATIONDIR)/includes.mk
22
23 # Non-default targets
24 idl: $(LIBJSOC_MAIN_SOCK_I)
25 dsds: $(LIBSOIJSOC) $(LIBDSDS)
26 examples: $(EXAMPLES)
27 sums: $(SUMS_BIN)
28 universe: targets idl dsds examples sums $(LIBDSPUTIL)
29
30 # General directory-independent flags (MUST BE DEFINED BEFORE THE SECTION
31 # "General directory-independent rules"
32 $(FPICOBJ): CF_TGT := $(CF_TGT) -fPIC
33
34 $(FIOBJ): CF_TGT := $(CF_TGT) -DFLIB
35
36 $(IIOBJ): CF_TGT := $(CF_TGT) -DIDLLIB
37
38 # General directory-independent rules
39 %.c: %.pgc
40 $(ECPG)
41 %.c: %.i
42 $(SWIG)
43
44 %.o: %.f
45 $(FCOMP)
46
47 %.o: %.f90
48 $(FCOMP)
49
50 # If a .f file is to be compiled more than one, the Rules.mk file that
51 # contains the rules for that .f file exists in a subdirectory of the
52 # directory that contains the .f file. As a result, the stem of the
53 # of the corresponding .o file is the child of the stem of the .f file.
54 %.o: ../%.f
55 $(FCOMP)
56
57 %.o: ../%.f90
58 $(FCOMP)
59
60 %.o: %.c
61 $(COMP)
62
63 # If a .c file is to be compiled more than one, the Rules.mk file that
64 # contains the rules for that .c file exists in a subdirectory of the
65 # directory that contains the .c file. As a result, the stem of the
66 # of the corresponding .o file is the child of the stem of the .c file.
67 %.o: ../%.c
68 $(COMP)
69
70 %: %.o
71 $(LINK)
72
73 %: %.c
74 $(COMPLINK)
75
76
77 # These two targets collect real targets, i.e. ones that can be built.
78
79 .PHONY: targets
80 targets: $(TGT_BIN) $(TGT_LIB)
81
82 # These targets merely contain commands to be executed, i.e. they collect
83 # only .PHONY targets, even if they're not explicitly marked as such.
84 # The install target does not collect dependencies (other than for forcing
85 # things to be built) because it's always considered 'out of date' anway as
86 # it's a .PHONY target. Instead, it collects installation commands that will be
87 # ran in addition to the standard ones to install the known targets.
88
89 .PHONY: clean
90 clean:
91 rm -f $(CLEAN)
92
93 # Prevent make from removing any build targets, including intermediate ones
94
95 .SECONDARY: $(CLEAN)