blob: 7dc6a691c3dc5a275d1c4a935aec7e2bb5db9406 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
$NetBSD: patch-aa,v 1.2 2002/10/30 07:56:09 agc Exp $
--- makefile 2002/10/24 09:41:47 1.1
+++ makefile 2002/10/24 09:42:36
@@ -18,7 +18,7 @@
#AR= echo
# Unix, generally
-CC = gcc -fpic
+CC = gcc
DEBUG=-g -Wall -Wno-char-subscripts -O
Osuf=o
SOsuf=so
@@ -28,12 +28,13 @@
OUT = -o $@
RM= -rm -f
AR= ar crs
+SYS_LIBS= -lm
# Linux
LD = gcc
LDFLAGS = -shared
DEBUG=-g -Wno-char-subscripts -O
-SYS_LIBS= -ldl
+#SYS_LIBS= -ldl
PLATFORM_FEATURES= -DSUN_DL=1
@@ -47,26 +48,31 @@
#LIBPREFIX = lib
#OUT = -o $@
-FEATURES = $(PLATFORM_FEATURES) -DUSE_DL=1 -DUSE_MATH=0 -DUSE_ASCII_NAMES=0
+DIRS= -DTINYSCHEMEPREFIX='"${PREFIX}"' -DTINYSCHEMEDIR='"/share/tinyscheme/"'
+FEATURES = ${DIRS} $(PLATFORM_FEATURES) -DUSE_DL=1 -DUSE_MATH=0 -DUSE_ASCII_NAMES=0
OBJS = scheme.$(Osuf) dynload.$(Osuf)
LIBTARGET = $(LIBPREFIX)tinyscheme.$(SOsuf)
STATICLIBTARGET = $(LIBPREFIX)tinyscheme.$(LIBsuf)
-all: $(LIBTARGET) $(STATICLIBTARGET) scheme$(EXE_EXT)
+all: $(STATICLIBTARGET) scheme$(EXE_EXT)
-%.$(Osuf): %.c
- $(CC) -I. -c $(DEBUG) $(FEATURES) $(DL_FLAGS) $<
-
-$(LIBTARGET): $(OBJS)
- $(LD) $(LDFLAGS) $(OUT) $(OBJS) $(SYS_LIBS)
+.c.o:
+ ${LIBTOOL} --mode=compile ${CC} -I. -c $(DEBUG) $(FEATURES) $(DL_FLAGS) $<
scheme$(EXE_EXT): $(OBJS)
- $(CC) -o $@ $(DEBUG) $(OBJS) $(SYS_LIBS)
+ ${LIBTOOL} --mode=link ${CC} -o $@ ${DEBUG} ${OBJS} ${SYS_LIBS} ${LIBS:.a=.la} -o scheme${EXE_EXT}
$(STATICLIBTARGET): $(OBJS)
- $(AR) $@ $(OBJS)
+ ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} -rpath ${PREFIX}/lib -version-info 1:31
+
+install: all
+ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${STATICLIBTARGET:.a=.la} ${PREFIX}/lib
+ ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} scheme${EXE_EXT} ${PREFIX}/bin/tinyscheme
+ ${BSD_INSTALL_DATA_DIR} ${PREFIX}/share/tinyscheme
+ ${BSD_INSTALL_DATA} init.scm ${PREFIX}/share/tinyscheme
+ ${BSD_INSTALL_DATA} scheme.h ${PREFIX}/include/tinyscheme.h
$(OBJS): scheme.h scheme-private.h opdefines.h
dynload.$(Osuf): dynload.h
|