(file) Return to Rules.mk CVS log (file) (dir) Up to [Development] / JSOC

 1 arta  1.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	:= src
18           -include		$(SRCDIR)/$(dir)/Rules.mk
19           
20           # Non-default targets
21           idl:		$(LIBJSOC_MAIN_SOCK_I)
22 arta  1.1 dsds:		$(LIBSOIJSOC) $(LIBDSDS)
23           examples:	$(EXAMPLES)
24           sums:		$(SUMS_BIN)
25           universe:	targets idl dsds examples sums $(LIBDSPUTIL)
26           
27           # General directory-independent flags (MUST BE DEFINED BEFORE THE SECTION
28           # "General directory-independent rules"
29           $(FPICOBJ):	CF_TGT := $(CF_TGT) -fPIC
30           
31           $(FIOBJ):	CF_TGT := $(CF_TGT) -DFLIB
32           
33           $(IIOBJ):	CF_TGT := $(CF_TGT) -DIDLLIB
34           
35           # General directory-independent rules
36           %.c:		%.pgc
37           		$(ECPG)
38           
39           %.o:		%.f
40           		$(FCOMP)
41           
42           # If a .f file is to be compiled more than one, the Rules.mk file that
43 arta  1.1 # contains the rules for that .f file exists in a subdirectory of the 
44           # directory that contains the .f file.  As a result, the stem of the 
45           # of the corresponding .o file is the child of the stem of the .f file.
46           %.o:		../%.f
47           		$(FCOMP)
48           
49           %.o:		%.c
50           		$(COMP)
51           
52           # If a .c file is to be compiled more than one, the Rules.mk file that
53           # contains the rules for that .c file exists in a subdirectory of the 
54           # directory that contains the .c file.  As a result, the stem of the 
55           # of the corresponding .o file is the child of the stem of the .c file.
56           %.o:		../%.c
57           		$(COMP)
58           
59           %:		%.o
60           		$(LINK)
61           
62           %:		%.c
63           		$(COMPLINK)
64 arta  1.1 
65           
66           # These two targets collect real targets, i.e. ones that can be built.
67           
68           .PHONY:		targets
69           targets:	$(TGT_BIN) $(TGT_LIB)
70           
71           # These targets merely contain commands to be executed, i.e. they collect
72           # only .PHONY targets, even if they're not explicitly marked as such. 
73           # The install target does not collect dependencies (other than for forcing
74           # things to be built) because it's always considered 'out of date' anway as
75           # it's a .PHONY target. Instead, it collects installation commands that will be
76           # ran in addition to the standard ones to install the known targets.
77           
78           .PHONY:		clean
79           clean:
80           		rm -f $(CLEAN)
81           
82           # Prevent make from removing any build targets, including intermediate ones
83           
84           .SECONDARY:	$(CLEAN)
85 arta  1.1 

Karen Tian
Powered by
ViewCVS 0.9.4