Artifact Content
Not logged in

Artifact a3d1cb71e3af4f301d41ab15b6ebbd0ef1e08b2f:

# Generic makefile, for crosscompiling use make -f Makefile.<target>

INCLUDES   = -I$(NDK)/usr/include -I$(NDK)/usr/local/include/
SWIG       = /usr/local/bin/swig
TARGETS    = threefish.fsx
LIBRARY    = libthreefish.fs
OPTIONS    = -forth -no-sectioncomments -use-structs -stackcomments $(INCLUDES)
INSTALL	= /usr/bin/install -c
VERSION	= `gforth --version 2>&1 | cut -f2 -d' '`
SHELL	= /bin/sh
RMTREE	= rm -rf
prefix = 
exec_prefix = ${prefix}
libexecdir = $(package)${exec_prefix}/lib
libccdir = $(subst $(DESTDIR),,$(libexecdir)/gforth$(ARCH)/$(VERSION)/libcc-named/)
srcdir = .
DESTDIR = /home/bernd/proj/net2o

all: $(TARGETS)

build-libcc-named: $(LIBRARY) $(TARGETS)
		$(RMTREE) lib/gforth$(ARCH)/$(VERSION)/libcc-named/
		-for i in $(LIBRARY); do ./libforth$(SUFFIX) -e "s\" `pwd`/lib/gforth$(ARCH)/$(VERSION)/libcc-named/\" libcc-named-dir-v 2! libcc-path clear-path libcc-named-dir libcc-path also-path :noname 2drop s\" $(DESTDIR)$(libccdir)\" ; is replace-rpath" $(srcdir)/$$i -e bye; done

libs: build-libcc-named $(LIBRARY)
	for i in $(LIBRARY); do \
	    $(LIBTOOL) --silent --mode=install $(INSTALL) lib/gforth$(ARCH)/$(VERSION)/libcc-named/libgf`basename $$i .fs`.la $(DESTDIR)$(libccdir)libgf`basename $$i .fs`.la; \

# execute compiled file
%.fs: %.fsx
	./$< -gforth > $@

# compile fsi-file
%.fsx: %-fsi.c
	$(CC) -o $@ $<

# use swig to create the fsi file
%-fsi.c: %.i
	$(SWIG) $(OPTIONS) -o $@ $(patsubst %-fsi.c, %.i, $@)

run: $(DEMO)
	gforth $(DEMO)

.PHONY: clean

	rm -f $(TARGETS)
	rm -f $(patsubst %.fsx, %-fsi.c, $(TARGETS))
	rm -f $(patsubst %.fsx, %.fs, $(TARGETS))