0
|
1 PREFIX = /usr/local
|
|
2
|
|
3 MAJOR = 0
|
|
4 MINOR = 2
|
|
5 REVISION = 0
|
|
6 VER = ${MAJOR}.${MINOR}.${REVISION}
|
|
7
|
|
8 CC = gcc
|
|
9 OBJS = guess.o
|
|
10 SRCS = ${OBJS:.o=.c} guess_tab.c libguess.h test.c
|
|
11 LIBS = libguess.so libguess.a
|
|
12 CFLAGS += -fPIC
|
|
13 SONAME = libguess.so.${MAJOR}
|
|
14
|
|
15
|
|
16 all: $(LIBS)
|
|
17
|
|
18 libguess.so: ${OBJS}
|
|
19 ${CC} -o libguess.so -shared -Wl,-soname,${SONAME} ${OBJS}
|
|
20
|
|
21 libguess.a: ${OBJS}
|
|
22 ar rc libguess.a ${OBJS}
|
|
23 ranlib libguess.a
|
|
24
|
|
25 $(OBJS) : $(SRCS)
|
|
26
|
|
27 guess_tab.c : guess.scm
|
|
28 gosh guess.scm guess_tab.c
|
|
29
|
|
30 test: test.c guess.c
|
|
31 gcc -g -o test test.c guess.c
|
|
32
|
|
33 install:
|
|
34 install -m644 libguess.h ${PREFIX}/include
|
|
35 rm -f ${PREFIX}/lib/libguess.*
|
|
36 install -m755 libguess.so ${PREFIX}/lib/libguess.so.${VER}
|
|
37 install -m644 libguess.a ${PREFIX}/lib
|
|
38 ln -sf ${PREFIX}/lib/libguess.so.${VER} ${PREFIX}/lib/libguess.so.${MAJOR}
|
|
39 ln -sf ${PREFIX}/lib/libguess.so.${MAJOR} ${PREFIX}/lib/libguess.so
|
|
40
|
|
41 clean:
|
|
42 rm -f $(LIBS) $(OBJS) test
|
|
43
|
|
44 distclean: clean
|
|
45 rm -f *~ core*
|