gforth/Makefile |
18 | 18 | PKG_NAME:=gforth |
19 | 19 | PKG_SNAPSHOT_DATE=20100725 |
20 | 20 | PKG_VERSION=0.7.0-$(PKG_SNAPSHOT_DATE) |
21 | | PKG_RELEASE:=10 |
| 21 | PKG_RELEASE:=11 |
22 | 22 | |
23 | 23 | PKG_BUILD_DEPENDS:= gforth/host libltdl/host |
24 | 24 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) |
... | ... | |
92 | 92 | $(call Host/Install/Default) |
93 | 93 | endef |
94 | 94 | |
95 | | # todo: skipcode= |
96 | | # todo: compiler options / tuning (openwrt sets bad defaults?) |
97 | | # todo: either gcc 3.4 or -Os makes primitives use doubly-indirect dispatch :( |
98 | | |
99 | 95 | ## Configuration of the target gforth |
100 | 96 | FORTHSIZES=--dictionary-size=1M \ |
101 | 97 | --data-stack-size=16k \ |
... | ... | |
110 | 106 | ## Here we call configure, then patch the cross-GForth source tree to replace |
111 | 107 | ## the 'preforth' script with a script that calls our host-compiled GForth. |
112 | 108 | ## We also extract the name of the GForth kernel image used for the target |
113 | | ## architecture. |
| 109 | ## architecture, and the source files used by GForth for implementing the |
| 110 | ## assembler/disassembler for the target architecture. |
114 | 111 | define Build/Configure |
115 | 112 | $(call Build/Configure/Default,) |
116 | 113 | echo "@kernel_fi@" > $(PKG_BUILD_DIR)/kernel_fi.in |
117 | 114 | cd $(PKG_BUILD_DIR) && ./config.status --file kernel_fi |
| 115 | echo "@asm_fs@ @disasm_fs@" > $(PKG_BUILD_DIR)/asm_fs.in |
| 116 | cd $(PKG_BUILD_DIR) && ./config.status --file asm_fs |
118 | 117 | echo "#!/bin/sh" > $(CROSS_PREFORTH) |
119 | 118 | echo "export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib;" >> $(CROSS_PREFORTH) |
120 | 119 | echo '$(STAGING_DIR_HOST)/bin/gforth -i $(STAGING_DIR_HOST)/lib/gforth/$(PKG_VERSION)/gforth.fi "$$$$@"' >> $(CROSS_PREFORTH) |
... | ... | |
126 | 125 | ## compilation, then running the GForth binary through unit-tests. This won't |
127 | 126 | ## work with a cross-compile environment. |
128 | 127 | ## |
129 | | ## todo: find out the correct kernel image and rename it 'kernel.fi', so we |
130 | | ## can find it without adapting postinst script. |
| 128 | ## Todo: we currently always build the -ll-reg version of the engine. On |
| 129 | ## 64-bit architectures this might not work? Damn it, why is the check for |
| 130 | ## 'long long' in the Gforth Makefile, not the configure script? |
| 131 | ## Todo: develop a clean upstream patch to configure/Makefile |
131 | 132 | define Build/Compile |
132 | 133 | $(MAKE) -C $(PKG_BUILD_DIR) kernel/version.fs gforth-ditc \ |
133 | 134 | engine/prim-fast.i engine/prim_lab-fast.i engine/prim_names-fast.i \ |
... | ... | |
145 | 146 | ## define lists of GForth's sources to package for loading in the target system |
146 | 147 | ## |
147 | 148 | |
148 | | STARTUP = exboot.fs startup.fs arch/mips/asm.fs arch/mips/disasm.fs |
149 | | |
150 | 149 | GFORTH_FI_SRC = \ |
151 | 150 | assert.fs \ |
152 | 151 | backtrac.fs \ |
... | ... | |
192 | 191 | vt100.fs \ |
193 | 192 | vt100key.fs \ |
194 | 193 | wordinfo.fs \ |
| 194 | arch/386/asm.fs arch/386/disasm.fs \ |
| 195 | arch/amd64/asm.fs arch/amd64/disasm.fs \ |
| 196 | arch/alpha/asm.fs arch/alpha/disasm.fs arch/alpha/testasm.fs\ |
| 197 | arch/arm/asm.fs arch/arm/disasm.fs \ |
| 198 | arch/arm/testdisasm.fs arch/arm/testdisasm.out arch/arm/Makefile \ |
195 | 199 | arch/mips/asm.fs arch/mips/disasm.fs arch/mips/insts.fs \ |
196 | | arch/mips/testasm.fs arch/mips/testdisasm.fs |
| 200 | arch/mips/testasm.fs arch/mips/testdisasm.fs \ |
| 201 | arch/power/asm.fs arch/power/disasm.fs arch/power/inst.fs |
197 | 202 | |
198 | 203 | LIBCC_SRC = cstr.fs unix/socket.fs |
199 | 204 | LIBCC_DIST_SRC = libffi.fs fflib.fs $(LIBCC_SRC) |
... | ... | |
247 | 252 | |
248 | 253 | FORTHKFLAGS= --die-on-signal -i kernel.fi |
249 | 254 | |
| 255 | ## make sure this is never evaluated before the configure step ran, else |
| 256 | ## $(shell) below is going to fail! We use the $(shell) to use the correct |
| 257 | ## Gforth assembler implementation that was chosen by gforth's configure |
| 258 | ## script, when building the forth image. |
| 259 | STARTUP = exboot.fs startup.fs $(shell cat $(PKG_BUILD_DIR)/asm_fs) |
| 260 | |
250 | 261 | ## Directly after installation load the source once and generate a |
251 | 262 | ## corresponding interpreter image. GForth needs that for quick startup. |
252 | 263 | define Package/gforth/postinst |
... | ... | |
263 | 274 | |
264 | 275 | $(eval $(call HostBuild)) |
265 | 276 | $(eval $(call BuildPackage,gforth)) |
| 277 | |
| 278 | # The following comments configure the Emacs editor. Just ignore them. |
| 279 | # Local Variables: |
| 280 | # compile-command: "make -C ~/h/src/qi/openwrt-xburst package/gforth/compile -j2 V=99" |
| 281 | # End: |