1# Makefile for CLISP module set matlab
2# <http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/apiref.shtml>
3
4srcdir = .
5CC = gcc
6CPPFLAGS =
7CFLAGS = -Wall -O2
8# MATLAB = /usr/local/matlab/extern/include
9MATLAB = d:/MATLAB7/extern/include
10CLISP = clisp -q -norc
11CLISP_LINKKIT = $$($(CLISP) -b)/linkkit
12
13LN = ln
14LN_S = ln -s
15
16MAKE = make
17
18SHELL = /bin/sh
19
20GENERATED = matlab.fas matlab.o wrap.fas link.sh
21DISTRIBFILES = Makefile $(GENERATED) \
22	$(srcdir)/matlab.lisp $(srcdir)/wrap.lisp
23distribdir =
24
25# default target: make the module
26clisp-module : $(GENERATED)
27
28matlab.c matlab.fas : $(srcdir)/matlab.lisp
29	$(CLISP) -c $(srcdir)/matlab.lisp -o ./
30
31matlab.o : matlab.c
32	$(CC) $(CFLAGS) -I$(CLISP_LINKKIT) -I$(MATLAB) -c matlab.c
33
34wrap.fas: $(srcdir)/wrap.lisp
35	$(CLISP) -c $(srcdir)/wrap.lisp -o ./
36
37link.sh : $(srcdir)/link.sh
38	$(LN_S) $(srcdir)/link.sh .
39
40# Make a module distribution into $(distribdir)
41clisp-module-distrib : clisp-module force
42	$(LN) $(DISTRIBFILES) $(distribdir)
43
44clean : force
45	rm -f core *.o *.a *.fas *.lib
46
47distclean : clean
48
49force :
50
51