ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/target.mk
Revision: 1.24
Committed: Wed Mar 10 23:58:46 2010 UTC (13 years, 6 months ago) by arta
Branch: MAIN
CVS Tags: NetDRMS_Ver_2-2, NetDRMS_Ver_2-3, NetDRMS_Ver_2-1, Ver_5-7, Ver_5-9, Ver_5-8, Ver_5-10
Changes since 1.23: +1 -0 lines
Log Message:
Allow NetDRMS sites to cherry-pick SU proj directories - by listing the directories desired in the config.local file, the configure/make system will automatically know how to build them.

File Contents

# Content
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 ifeq ($(MACH),)
14 MACH = $(JSOC_MACHINE)
15 endif
16
17 OBJDIR := _$(MACH)
18 PROJOBJDIR := $(OBJDIR)/proj
19
20 all: $(PROJOBJDIR) $(OBJDIR)
21
22 # Define the rules to build in the target subdirectories.
23 #
24 MAKETARGET = $(MAKE) --no-print-directory -C $@ -f $(WORKINGDIR)/Makefile \
25 SRCDIR=$(WORKINGDIR) $(MAKECMDGOALS)
26
27 .PHONY: $(PROJOBJDIR) $(OBJDIR)
28
29 # Create the project-specific directories too, if they exist.
30 # This supplementary target.mk files is part of the cvs tree
31 -include $(WORKINGDIR)/proj/target.mk
32
33 $(OBJDIR):
34 +@[ -d bin/$(MACH) ] || mkdir -p bin/$(MACH)
35 +@[ -d lib/$(MACH) ] || mkdir -p lib/$(MACH)
36 +@[ -d $@ ] || mkdir -p $@
37 +@[ -d $@/base/drms/apps ] || mkdir -p $@/base/drms/apps
38 +@[ -d $@/base/drms/libs/api/client ] || mkdir -p $@/base/drms/libs/api/client
39 +@[ -d $@/base/drms/libs/api/client_fpic ] || mkdir -p $@/base/drms/libs/api/client_fpic
40 +@[ -d $@/base/drms/libs/api/server ] || mkdir -p $@/base/drms/libs/api/server
41 +@[ -d $@/base/drms/libs/main/c ] || mkdir -p $@/base/drms/libs/main/c
42 +@[ -d $@/base/drms/libs/main/f ] || mkdir -p $@/base/drms/libs/main/f
43 +@[ -d $@/base/drms/libs/main/idl ] || mkdir -p $@/base/drms/libs/main/idl
44 +@[ -d $@/base/drms/libs/meta ] || mkdir -p $@/base/drms/libs/meta
45 +@[ -d $@/base/export/apps ] || mkdir -p $@/base/export/apps
46 +@[ -d $@/base/export/libs/util ] || mkdir -p $@/base/export/libs/util
47 +@[ -d $@/base/libs/cmdparams/test ] || mkdir -p $@/base/libs/cmdparams/test
48 +@[ -d $@/base/libs/db/client ] || mkdir -p $@/base/libs/db/client
49 +@[ -d $@/base/libs/db/client_fpic ] || mkdir -p $@/base/libs/db/client_fpic
50 +@[ -d $@/base/libs/db/server ] || mkdir -p $@/base/libs/db/server
51 +@[ -d $@/base/libs/defs/fpic ] || mkdir -p $@/base/libs/defs/fpic
52 +@[ -d $@/base/libs/dstruct/fpic ] || mkdir -p $@/base/libs/dstruct/fpic
53 +@[ -d $@/base/libs/json ] || mkdir -p $@/base/libs/json
54 +@[ -d $@/base/libs/inthandles ] || mkdir -p $@/base/libs/inthandles
55 +@[ -d $@/base/libs/qdecoder/md5 ] || mkdir -p $@/base/libs/qdecoder/md5
56 +@[ -d $@/base/libs/threads/fpic ] || mkdir -p $@/base/libs/threads/fpic
57 +@[ -d $@/base/libs/timeio/fpic ] || mkdir -p $@/base/libs/timeio/fpic
58 +@[ -d $@/base/libs/misc/fpic ] || mkdir -p $@/base/libs/misc/fpic
59 +@[ -d $@/base/libs/fitsrw/fpic ] || mkdir -p $@/base/libs/fitsrw/fpic
60 +@[ -d $@/base/libs/errlog ] || mkdir -p $@/base/libs/errlog
61 +@[ -d $@/base/local/libs/dsds ] || mkdir -p $@/base/local/libs/dsds
62 +@[ -d $@/base/local/libs/soi ] || mkdir -p $@/base/local/libs/soi
63 +@[ -d $@/base/sums/apps ] || mkdir -p $@/base/sums/apps
64 +@[ -d $@/base/sums/libs/api ] || mkdir -p $@/base/sums/libs/api
65 +@[ -d $@/base/sums/libs/api/perl ] || mkdir -p $@/base/sums/libs/api/perl
66 +@[ -d $@/base/sums/libs/pg ] || mkdir -p $@/base/sums/libs/pg
67 +@[ -d $@/base/util/apps ] || mkdir -p $@/base/util/apps
68 +@[ -d $@/proj/example/apps ] || mkdir -p $@/proj/example/apps
69 +@[ -d $@/proj/myproj/apps ] || mkdir -p $@/proj/myproj/apps
70 +@[ -d $@/proj/cookbook ] || mkdir -p $@/proj/cookbook
71 +@$(MAKETARGET)
72
73 # These rules keep make from trying to use the match-anything rule below to
74 # rebuild the makefiles--ouch! Obviously, if you don't follow my convention
75 # of using a `.mk' suffix on all non-standard makefiles you'll need to change
76 # the pattern rule.
77 #
78 Makefile : ;
79 %.mk :: ;
80
81
82 # Anything we don't know how to build will use this rule. The command is a
83 # do-nothing command, but the prerequisites ensure that the appropriate
84 # recursive invocations of make will occur.
85 #
86 % :: $(PROJOBJDIR) $(OBJDIR) ; :
87
88
89 # The clean rule is best handled from the source directory: since we're
90 # rigorous about keeping the target directories containing only target files
91 # and the source directory containing only source files, `clean' is as trivial
92 # as removing the target directories!
93 #
94 .PHONY: clean
95 clean:
96 rm -rf $(OBJDIR); rm -rf bin/$(MACH); rm -rf lib/$(MACH)
97