summaryrefslogtreecommitdiff
path: root/examples.ext/Makefile
blob: fa5cfc68070ecfd30d6c650299c0aa97a8b7c258 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Note that if cross compiling, build with:
#
#   make NOTEST=1
#
# to avoid trying to load the resulting module.
# Also note that you will need a build-host version of jimsh in the
# PATH in order to build the extension.

# Prefer jimsh in the PATH because it is more likely to be built
# for the build-host rather than the target.

ifdef NOTEST
BUILDOPTS := --notest
endif

export PATH := $(PATH):..

all: helloworld.so

helloworld.so: helloworld.c
	../build-jim-ext -I.. -L.. $(BUILDOPTS) $^

# Note: Currently we don't attempt to set LD_LIBRARY_PATH or equivalent

test:
	JIMLIB=. ../jimsh -e 'package require helloworld; hello'

clean:
	rm -f *.o *.so