Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | # ========== Copyright Header Begin ========================================== |
2 | # | |
3 | # OpenSPARC T2 Processor File: Makefile | |
4 | # Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
5 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
6 | # | |
7 | # The above named program is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU General Public | |
9 | # License version 2 as published by the Free Software Foundation. | |
10 | # | |
11 | # The above named program is distributed in the hope that it will be | |
12 | # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public | |
17 | # License along with this work; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
19 | # | |
20 | # ========== Copyright Header End ============================================ | |
21 | # | |
22 | # "@(#)1.2 06/04/24 Makefile, top level, SAM." | |
23 | # | |
24 | # ---------------- conditional/dependent defines ------------- | |
25 | ||
26 | ||
27 | include Makefile.defines | |
28 | include Makefile.targetspecs | |
29 | ||
30 | # ----------------------------------------------------------------- | |
31 | # help: | |
32 | # ----------------------------------------------------------------- | |
33 | ||
34 | help: | |
35 | @echo "specify target:" | |
36 | @echo " cpu - cpu one of: $(ANYBUILD)" | |
37 | @echo " clean - clean all" | |
38 | ||
39 | # ----------------------------------------------------------------- | |
40 | # $(ANYBUILD): | |
41 | # | |
42 | # Build devices first. Then we build our cpu model, and | |
43 | # we fiish with some analysers and other things (system for example). | |
44 | # ----------------------------------------------------------------- | |
45 | ||
46 | SOL10.sh = echo $$SOL10 | |
47 | SOL10 = $(SOL10.sh:sh) | |
48 | ||
49 | ||
50 | $(ANYBUILD): FRC | |
51 | @if [ "`/bin/uname -r`" = "5.10" -a "$(SOL10)" != "OK" ] ; then \ | |
52 | echo 'Do not build on a s10 machine (use make SOL10=OK $@ to overwrite,' ; \ | |
53 | echo 'or do setenv SOL10 OK)' ; \ | |
54 | /bin/false ; \ | |
55 | fi | |
56 | @if [ "$(CHECK_MODE)" = "" ]; then \ | |
57 | echo "MODE=$(MODE) is unknown, try g or opt." ;\ | |
58 | /bin/false ;\ | |
59 | fi | |
60 | @if [ "$(CHECK_ARCH)" = "" ]; then \ | |
61 | echo "ARCH=$(ARCH) is unknown, try v9, v8plus, or amd64." ;\ | |
62 | /bin/false ;\ | |
63 | fi | |
64 | - /bin/mkdir -p $(INSTALL_DIRS) | |
65 | if [ "$(DEVICES.$(EXPORT_OK))" != "" ]; then \ | |
66 | for f in `echo "$(DEVICES.$(EXPORT_OK))"` ; do \ | |
67 | ( \ | |
68 | cd devices/$$f ;\ | |
69 | $(MAKE) $(PASSDOWN) TREEPATH="devices/$$f" \ | |
70 | ) \ | |
71 | done \ | |
72 | fi ;\ | |
73 | ( \ | |
74 | cd cpus/$(CPU_DIR); \ | |
75 | $(MAKE) $(CPU) $(PASSDOWN) TREEPATH="cpus/$(CPU_DIR)" \ | |
76 | ) ;\ | |
77 | if [ "$(ANALYZERS)" != "" ]; then \ | |
78 | for f in `echo "$(ANALYZERS)"` ; do \ | |
79 | ( \ | |
80 | cd analyzers/$$f ;\ | |
81 | $(MAKE) $(PASSDOWN) TREEPATH="analyzers/$$f" \ | |
82 | ) ; \ | |
83 | done \ | |
84 | fi ;\ | |
85 | if [ "$(OTHER)" != "" ]; then \ | |
86 | for f in `echo "$(OTHER)"` ; do \ | |
87 | ( \ | |
88 | cd $$f ;\ | |
89 | $(MAKE) $(PASSDOWN) TREEPATH="$$f" \ | |
90 | ) \ | |
91 | done \ | |
92 | fi ;\ | |
93 | if [ "$(IMPORT)" != "" ]; then \ | |
94 | $(MAKE) $(PASSDOWN) $(IMPORT) ;\ | |
95 | fi | |
96 | ||
97 | ||
98 | # ----------------------------------------------------------------- | |
99 | # clean: | |
100 | # | |
101 | # This target cleans out all the make targets and intermittend | |
102 | # results that get produced by the build processes | |
103 | # ----------------------------------------------------------------- | |
104 | ||
105 | clean: | |
106 | /bin/rm -rf $(BUILD_ROOT) $(ANYBUILD:%=install-%) | |
107 | ( cd cpus/vonk ; $(MAKE) clean $(PASSDOWN) TREEPATH="cpus/vonk" ) | |
108 | ( cd devices/py ; $(MAKE) $(PASSDOWN) clean ) | |
109 | /bin/rm -fr nas,5.n2.opens.$(USER) | |
110 | ||
111 | include Makefile.rules | |
112 | include Makefile.release | |
113 | ||
114 | # ----------------------------------------------------------------- | |
115 | # cscope | |
116 | # ----------------------------------------------------------------- | |
117 | ||
118 | cscope.out: cscope.files | |
119 | cscope -b | |
120 | ||
121 | cscope.files: FRC | |
122 | @$(RM) cscope.files cscope.files.raw | |
123 | -find . -name SCCS -prune -o -name deleted_files -prune -o -type f \ | |
124 | \( -name "*.[chs]" -o -name "*.cc" -o -name "Makefile*" \ | |
125 | -o -name '*.il*' \) -print > cscope.files.raw | |
126 | grep -v Makefile cscope.files.raw > cscope.files | |
127 | grep Makefile cscope.files.raw >> cscope.files | |
128 | @$(RM) cscope.files.raw | |
129 | ||
130 | ||
131 | # ------------------------- -=oOo=- ------------------------ |