Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / include / asm-cris / arch-v32 / hwregs / iop / Makefile
bloba90056a095e33674a6144ea1df157a4624ce8939
1 # $Id: Makefile,v 1.3 2004/01/07 20:34:55 johana Exp $
2 # Makefile to generate or copy the latest register definitions
3 # and related datastructures and helpermacros.
4 # The offical place for these files is probably at:
5 RELEASE ?= r1_alfa5
6 IOPOFFICIAL_INCDIR = /n/asic/projects/guinness/releases/$(RELEASE)/design/top/sw/include/
8 IOPROCDIR = /n/asic/design/io/io_proc/rtl
10 IOPROCINCL_FILES =
11 IOPROCINCL_FILES2=
12 IOPROCINCL_FILES += iop_crc_par_defs.h
13 IOPROCINCL_FILES += iop_dmc_in_defs.h
14 IOPROCINCL_FILES += iop_dmc_out_defs.h
15 IOPROCINCL_FILES += iop_fifo_in_defs.h
16 IOPROCINCL_FILES += iop_fifo_in_xtra_defs.h
17 IOPROCINCL_FILES += iop_fifo_out_defs.h
18 IOPROCINCL_FILES += iop_fifo_out_xtra_defs.h
19 IOPROCINCL_FILES += iop_mpu_defs.h
20 IOPROCINCL_FILES2+= iop_mpu_macros.h
21 IOPROCINCL_FILES2+= iop_reg_space.h
22 IOPROCINCL_FILES += iop_sap_in_defs.h
23 IOPROCINCL_FILES += iop_sap_out_defs.h
24 IOPROCINCL_FILES += iop_scrc_in_defs.h
25 IOPROCINCL_FILES += iop_scrc_out_defs.h
26 IOPROCINCL_FILES += iop_spu_defs.h
27 # in guiness/
28 IOPROCINCL_FILES += iop_sw_cfg_defs.h
29 IOPROCINCL_FILES += iop_sw_cpu_defs.h
30 IOPROCINCL_FILES += iop_sw_mpu_defs.h
31 IOPROCINCL_FILES += iop_sw_spu_defs.h
33 IOPROCINCL_FILES += iop_timer_grp_defs.h
34 IOPROCINCL_FILES += iop_trigger_grp_defs.h
35 # in guiness/
36 IOPROCINCL_FILES += iop_version_defs.h
38 IOPROCASMINCL_FILES = $(patsubst %_defs.h,%_defs_asm.h,$(IOPROCINCL_FILES))
39 IOPROCASMINCL_FILES+= iop_reg_space_asm.h
42 IOPROCREGDESC =
43 IOPROCREGDESC += $(IOPROCDIR)/iop_crc_par.r
44 #IOPROCREGDESC += $(IOPROCDIR)/iop_crc_ser.r
45 IOPROCREGDESC += $(IOPROCDIR)/iop_dmc_in.r
46 IOPROCREGDESC += $(IOPROCDIR)/iop_dmc_out.r
47 IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_in.r
48 IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_in_xtra.r
49 IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_out.r
50 IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_out_xtra.r
51 IOPROCREGDESC += $(IOPROCDIR)/iop_mpu.r
52 IOPROCREGDESC += $(IOPROCDIR)/iop_sap_in.r
53 IOPROCREGDESC += $(IOPROCDIR)/iop_sap_out.r
54 IOPROCREGDESC += $(IOPROCDIR)/iop_scrc_in.r
55 IOPROCREGDESC += $(IOPROCDIR)/iop_scrc_out.r
56 IOPROCREGDESC += $(IOPROCDIR)/iop_spu.r
57 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_cfg.r
58 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_cpu.r
59 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_mpu.r
60 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_spu.r
61 IOPROCREGDESC += $(IOPROCDIR)/iop_timer_grp.r
62 IOPROCREGDESC += $(IOPROCDIR)/iop_trigger_grp.r
63 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_version.r
66 RDES2C = /n/asic/bin/rdes2c
67 RDES2C = /n/asic/design/tools/rdesc/rdes2c
68 RDES2INTR = /n/asic/design/tools/rdesc/rdes2intr
69 RDES2TXT = /n/asic/design/tools/rdesc/rdes2txt
71 ## all - Just print help - you probably want to do 'make gen'
72 all: help
74 ## help - This help
75 help:
76 @grep '^## ' Makefile
78 ## gen - Generate include files
79 gen: $(IOPROCINCL_FILES) $(IOPROCINCL_FILES2) $(IOPROCASMINCL_FILES)
80 echo "INCL: $(IOPROCINCL_FILES)"
81 echo "INCL2: $(IOPROCINCL_FILES2)"
82 echo "ASMINCL: $(IOPROCASMINCL_FILES)"
84 # From the official location...
85 iop_reg_space.h: $(IOPOFFICIAL_INCDIR)/iop_reg_space.h
86 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
87 iop_mpu_macros.h: $(IOPOFFICIAL_INCDIR)/iop_mpu_macros.h
88 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
90 ## copy - Copy files from official location
91 copy:
92 @echo "## Copying and fixing iop files ##"
93 @for HFILE in $(IOPROCINCL_FILES); do \
94 echo " $$HFILE"; \
95 cat $(IOPOFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
96 done
97 @for HFILE in $(IOPROCINCL_FILES2); do \
98 echo " $$HFILE"; \
99 cat $(IOPOFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
100 done
101 @echo "## Copying and fixing iop asm files ##"
102 @for HFILE in $(IOPROCASMINCL_FILES); do \
103 echo " $$HFILE"; \
104 cat $(IOPOFFICIAL_INCDIR)asm/$$HFILE | sed -e 's/\$$Id\:/id\:/g' > asm/$$HFILE; \
105 done
107 # I/O processor files:
108 ## iop - Generate I/O processor include files
109 iop: $(IOPROCINCL_FILES) $(IOPROCINCL_FILES2) $(IOPROCASMINCL_FILES)
110 iop_sw_%_defs.h: $(IOPROCDIR)/guinness/iop_sw_%.r
111 $(RDES2C) $<
112 iop_version_defs.h: $(IOPROCDIR)/guinness/iop_version.r
113 $(RDES2C) $<
114 %_defs.h: $(IOPROCDIR)/%.r
115 $(RDES2C) $<
116 %_defs_asm.h: $(IOPROCDIR)/%.r
117 $(RDES2C) -asm $<
118 iop_version_defs_asm.h: $(IOPROCDIR)/guinness/iop_version.r
119 $(RDES2C) -asm $<
121 ## doc - Generate .axw files from register description.
122 doc: $(IOPROCREGDESC)
123 for RDES in $^; do \
124 $(RDES2TXT) $$RDES; \
125 done
127 .PHONY: axw
128 ## %.axw - Generate the specified .axw file (doesn't work for all files
129 ## due to inconsistent naming of .r files.
130 %.axw: axw
131 @for RDES in $(IOPROCREGDESC); do \
132 if echo "$$RDES" | grep $* ; then \
133 $(RDES2TXT) $$RDES; \
134 fi \
135 done
137 .PHONY: clean
138 ## clean - Remove .h files and .axw files.
139 clean:
140 rm -rf $(IOPROCINCL_FILES) *.axw
142 .PHONY: cleandoc
143 ## cleandoc - Remove .axw files.
144 cleandoc:
145 rm -rf *.axw