ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/mccabe.mk
Revision: 1.1.2.5
Committed: Thu Mar 9 15:34:16 2000 UTC (25 years, 2 months ago) by williamc
Branch: V0_9branch
CVS Tags: BuildSystemProto1, V0_18_0, V0_18_0model, V0_17_1, V0_18_0alpha, V0_17_0, V0_16_4, V0_16_3, V0_16_2, V0_16_1, V0_16_0, V0_15_1, V0_15_0, V0_15_0beta, V0_14_0, V0_12_12_4, V0_12_12_3, V0_13_3, V0_13_2, V0_12_12_2, V0_12_12_1, V0_12_12_0, PlayGround_0, V0_13_1, V0_13_0, V0_12_12, V0_12_11, V0_12_9b, V0_12_10, V0_12_9, V0_12_8, V0_12_7, V0_12_6, V0_12_5, V0_12_4, V0_12_3, V0_12_2, V0_12_1, V0_12_0, V0_11_4, V0_11_3, V0_11_2, V0_11_1, V0_11_0, V0_10_19, V0_10_18, V0_10_17, V0_10_16
Branch point for: V0_17branch, V0_16branch, V0_15branch, HPWbranch
Changes since 1.1.2.4: +3 -2 lines
Log Message:
update to cater for new binary structure

File Contents

# User Rev Content
1 williamc 1.1.2.1 vpath %.pcf $(LOCALTOP)/$(workdir):$(RELEASETOP)/$(workdir)
2    
3     #
4     # Some system variables - input through CAPITAL variables
5     #
6    
7     mccabe_extensions_pats:=$(addprefix %.,$(MCCABE_EXTENSIONS))
8     #mccabe_files:=$(filter %.cc %.cxx %.cpp %.C %.c,$(files))
9 williamc 1.1.2.5 allfiles:=$(files) $(locbinfiles)
10 williamc 1.1.2.4 mccabe_files:=$(filter $(mccabe_extensions_pats),$(allfiles))
11 williamc 1.1.2.1 mccabe_pcf_files_test:=$(patsubst %.cc,%_ccsrc.pcf,$(mccabe_files)))
12     pat_pcf=$(patsubst %.$(ext),%_$(ext)src.pcf,$(mccabe_files))
13     mccabe_pcf_files:=$(filter %.pcf,$(foreach ext,$(MCCABE_EXTENSIONS),$(pat_pcf)))
14 williamc 1.1.2.5 path_mccabe_pcf_files:=$(addprefix $(LOCALTOP)/$(workdir)/,$(mccabe_pcf_files))
15     mccabe_pcf_files:=$(notdir $(mccabe_pcf_files))
16 williamc 1.1.2.4 ifndef MCCABE_DATA_DIR
17     MCCABE_DATA_DIR:=$(LOCALTOP)/$(workdir)
18     endif
19 williamc 1.1.2.1
20     #
21     # Building pcf files
22     #
23    
24     # Create a pcf format line for each file in a seperate file
25    
26 williamc 1.1.2.2 MCCABECPPFLAGS=-DMCCABE
27    
28 williamc 1.1.2.1 %_ccsrc.pcf: %.cc
29 williamc 1.1.2.2 @echo $(MCCABE_PARSETAG_cc) $< $(MCCABECPPFLAGS) $(CPPFLAGS) > $@
30 williamc 1.1.2.1 %_cxxsrc.pcf: %.cxx
31 williamc 1.1.2.2 @echo $(MCCABE_PARSETAG_cxx) $< $(MCCABECPPFLAGS) $(CPPFLAGS) > $@
32 williamc 1.1.2.1 %_Csrc.pcf: %.C
33 williamc 1.1.2.2 @echo $(MCCABE_PARSETAG_C) $< $(MCCABECPPFLAGS) $(CPPFLAGS) > $@
34 williamc 1.1.2.1 %_cppsrc.pcf: %.cpp
35 williamc 1.1.2.2 @echo $(MCCABE_PARSETAG_cpp) $< $(MCCABECPPFLAGS) $(CPPFLAGS) > $@
36 williamc 1.1.2.1 %_csrc.pcf: %.c
37 williamc 1.1.2.2 @echo $(MCCABE_PARSETAG_c) $< $(MCCABECPPFLAGS) $(CPPFLAGS) > $@
38 williamc 1.1.2.1
39     %.i : %.cc
40     $(PreProcessorCCTool)
41    
42 williamc 1.1.2.3 pat_pcf=$(patsubst %.$(ext),%_$(ext)src.pcf,$(mccabe_files))
43     preprocess_files=$(patsubst %.cc, %.i, $(mccabe_files))
44    
45     ifdef SUBDIRS
46     .PHONY: preprocess
47     preprocess:
48     @for dir in $(SUBDIRS); do \
49     echo ----------- Generating PreProcessed files in $$dir ---------; \
50     cd $(LOCALTOP)/$(THISDIR)/$$dir; \
51     $(TOOL_HOME)/scram build preprocess; \
52     done
53     else
54     preprocess: $(preprocess_files)
55     endif
56    
57 williamc 1.1.2.1 #
58     # Exclude all header files not in this directory
59     #
60    
61     ifdef SUBDIRS
62     .PHONY: myheader.dat
63     myheader.dat:
64     @if [ -f myheader.dat ]; then \
65     rm myheader.dat; \
66     fi
67     @for dir in $(SUBDIRS); do \
68     echo ----------- Collecting Header Data from $$dir ---------; \
69     cd $(LOCALTOP)/$(THISDIR)/$$dir; \
70     $(TOOL_HOME)/scram build myheader.dat; \
71     cat $(LOCALTOP)/$(workdir)/$$dir/myheader.dat >> $(LOCALTOP)/$(workdir)/myheader.dat; \
72     done
73     else
74 williamc 1.1.2.4 mccabe_headers+=$(wildcard $(LOCALTOP)/$(THISDIR)/*.h) $(wildcard $(LOCALTOP)/$(THISDIR)/*.icc)
75 williamc 1.1.2.1 myheader.dat: $(files) $(mccabe_headers)
76     -@ls $(mccabe_headers) > myheader.dat
77     endif
78    
79     #
80     # Get all the combined srcs together into one pcf file
81     #
82    
83     ifdef SUBDIRS
84     .PHONY: src.pcf
85     srcpcf=$(wildcard */src.pcf)
86     src.pcf: $(srcpcf)
87     @if [ -f src.pcf ]; then \
88     rm src.pcf; \
89     fi
90     @for dir in $(SUBDIRS); do \
91     echo ----------- Collecting Compiler Options from $$dir ---------; \
92     cd $(LOCALTOP)/$(THISDIR)/$$dir; \
93     $(TOOL_HOME)/scram build src.pcf; \
94     cat $(LOCALTOP)/$(workdir)/$$dir/src.pcf >> $(LOCALTOP)/$(workdir)/src.pcf; \
95     done
96     else
97     src.pcf: $(mccabe_pcf_files) myheader.dat
98     @if [ "$(path_mccabe_pcf_files)" != "" ]; then \
99     cat $(path_mccabe_pcf_files) > src.pcf; \
100     fi
101     endif
102    
103     config.pcf: src.pcf myheader.dat
104 williamc 1.1.2.4 @echo PROGRAM test > config_tmp.pcf
105     @echo INSTDIR $(MCCABE_DATA_DIR)/mccabeinstr >> config_tmp.pcf
106     @echo INSTOUT $(MCCABE_DATA_DIR)/mccabeinstr/inst.out >> config_tmp.pcf
107     @echo DIR $(LOCALTOP)/$(THISDIR) >> config_tmp.pcf
108     @cat config_tmp.pcf src.pcf > config.pcf
109    
110     instplus.cpp: $(mccabe_files) config.pcf
111     cli export -pcf config.pcf
112 williamc 1.1.2.1
113 williamc 1.1.2.2 #mccabe_parse: config.pcf
114     # cli parse -pcf config.pcf -parse_report $(LOCALTOP)/$(INTlog)/mccabe
115    
116     mccabe_%: config.pcf
117     cli $* -pcf config.pcf -parse_report $(LOCALTOP)/$(INTlog)/mccabe $(MCCABE_CLI_OPTIONS)
118    
119     mccabe_purge:
120     cli purge -level all