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

 1 arta  1.1 # This is used to jump from a source directory to a target directory.
 2           
 3           .SUFFIXES:
 4           
 5           
 6           # Find the target directory(ies).
 7           #
 8           ifndef JSOC_MACHINE
 9             JSOC_MACHINE := $(shell build/jsoc_machine.csh)
10             export JSOC_MACHINE
11           endif
12           
13           OBJDIR 		:= _$(JSOC_MACHINE)
14 arta  1.5 PROJOBJDIR	:= $(OBJDIR)/proj
15 arta  1.1 
16           all:    $(PROJOBJDIR) $(OBJDIR)
17           
18           # Define the rules to build in the target subdirectories.
19           #
20           MAKETARGET = $(MAKE) --no-print-directory -C $@ -f $(CURDIR)/Makefile \
21           		SRCDIR=$(CURDIR) $(MAKECMDGOALS)
22           
23           .PHONY: $(PROJOBJDIR) $(OBJDIR) 
24           
25           # Create the project-specific directories too, if they exist.
26 arta  1.5 -include $(CURDIR)/proj/target.mk
27 arta  1.1 
28           $(OBJDIR):
29           	+@[ -d bin/$(JSOC_MACHINE) ] || mkdir -p bin/$(JSOC_MACHINE)
30           	+@[ -d lib/$(JSOC_MACHINE) ] || mkdir -p lib/$(JSOC_MACHINE)
31           	+@[ -d $@ ] || mkdir -p $@
32 arta  1.5 	+@[ -d $@/base/drms/apps ] || mkdir -p $@/base/drms/apps
33           	+@[ -d $@/base/drms/libs/api/client ] || mkdir -p $@/base/drms/libs/api/client
34           	+@[ -d $@/base/drms/libs/api/client_fpic ] || mkdir -p $@/base/drms/libs/api/client_fpic
35           	+@[ -d $@/base/drms/libs/api/server ] || mkdir -p $@/base/drms/libs/api/server
36           	+@[ -d $@/base/drms/libs/main/c ] || mkdir -p $@/base/drms/libs/main/c
37           	+@[ -d $@/base/drms/libs/main/f ] || mkdir -p $@/base/drms/libs/main/f
38           	+@[ -d $@/base/drms/libs/main/idl ] || mkdir -p $@/base/drms/libs/main/idl
39           	+@[ -d $@/base/drms/libs/meta ] || mkdir -p $@/base/drms/libs/meta
40           	+@[ -d $@/base/libs/cmdparams/fpic ] || mkdir -p $@/base/libs/cmdparams/fpic
41           	+@[ -d $@/base/libs/db/client ] || mkdir -p $@/base/libs/db/client
42           	+@[ -d $@/base/libs/db/client_fpic ] || mkdir -p $@/base/libs/db/client_fpic
43           	+@[ -d $@/base/libs/db/server ] || mkdir -p $@/base/libs/db/server
44           	+@[ -d $@/base/libs/dstruct/fpic ] || mkdir -p $@/base/libs/dstruct/fpic
45           	+@[ -d $@/base/libs/ricecomp/fpic ] || mkdir -p $@/base/libs/ricecomp/fpic
46           	+@[ -d $@/base/libs/inthandles ] || mkdir -p $@/base/libs/inthandles
47           	+@[ -d $@/base/libs/threads/fpic ] || mkdir -p $@/base/libs/threads/fpic
48           	+@[ -d $@/base/libs/timeio/fpic ] || mkdir -p $@/base/libs/timeio/fpic
49           	+@[ -d $@/base/libs/misc/fpic ] || mkdir -p $@/base/libs/misc/fpic
50 arta  1.6 	+@[ -d $@/base/libs/fitsrw/fpic ] || mkdir -p $@/base/libs/fitsrw/fpic
51 arta  1.5 	+@[ -d $@/base/local/libs/dsds ] || mkdir -p $@/base/local/libs/dsds
52           	+@[ -d $@/base/local/libs/soi ] || mkdir -p $@/base/local/libs/soi
53           	+@[ -d $@/base/sums/apps ] || mkdir -p $@/base/sums/apps
54           	+@[ -d $@/base/sums/libs/api ] || mkdir -p $@/base/sums/libs/api
55           	+@[ -d $@/base/sums/libs/pg ] || mkdir -p $@/base/sums/libs/pg
56           	+@[ -d $@/base/util/apps ] || mkdir -p $@/base/util/apps
57           	+@[ -d $@/proj/example/apps ] || mkdir -p $@/proj/example/apps
58           	+@[ -d $@/proj/myproj/apps ] || mkdir -p $@/proj/myproj/apps
59 arta  1.1 	+@$(MAKETARGET)
60           
61           # These rules keep make from trying to use the match-anything rule below to
62           # rebuild the makefiles--ouch!  Obviously, if you don't follow my convention
63           # of using a `.mk' suffix on all non-standard makefiles you'll need to change
64           # the pattern rule.
65           #
66           Makefile : ;
67           %.mk :: ;
68           
69           
70           # Anything we don't know how to build will use this rule.  The command is a
71           # do-nothing command, but the prerequisites ensure that the appropriate
72           # recursive invocations of make will occur.
73           #
74           % :: $(PROJOBJDIR) $(OBJDIR) ; :
75           
76           
77           # The clean rule is best handled from the source directory: since we're
78           # rigorous about keeping the target directories containing only target files
79           # and the source directory containing only source files, `clean' is as trivial
80 arta  1.1 # as removing the target directories!
81           #
82           .PHONY: clean
83           clean:
84           	rm -rf $(OBJDIR); rm -rf bin/$(JSOC_MACHINE); rm -rf lib/$(JSOC_MACHINE)
85           

Karen Tian
Powered by
ViewCVS 0.9.4