-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
98 lines (78 loc) · 1.84 KB
/
makefile
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Makefile for TinyScheme
# Time-stamp: <2002-06-24 14:13:27 gildea>
# Windows/2000
#CC = cl -nologo
#DEBUG= -W3 -Z7 -MD
#DL_FLAGS=
#SYS_LIBS=
#Osuf=obj
#SOsuf=dll
#LIBsuf=.lib
#EXE_EXT=.exe
#LD = link -nologo
#LDFLAGS = -debug -map -dll -incremental:no
#LIBPREFIX =
#OUT = -out:$@
#RM= -del
#AR= echo
# Unix, generally
CC = gcc -fpic -pedantic
DEBUG=-g -Wall -Wno-char-subscripts -O
Osuf=o
SOsuf=so
LIBsuf=a
EXE_EXT=
LIBPREFIX=lib
OUT = -o $@
RM= -rm -f
AR= ar crs
# Linux
LD = gcc
LDFLAGS = -shared
DEBUG=-g -Wno-char-subscripts -O
SYS_LIBS= -ldl -lm
PLATFORM_FEATURES= -DSUN_DL=1
# Cygwin
#PLATFORM_FEATURES = -DUSE_STRLWR=0
# MinGW/MSYS
#SOsuf=dll
#PLATFORM_FEATURES = -DUSE_STRLWR=0
# Mac OS X
#LD = gcc
#LDFLAGS = --dynamiclib
#DEBUG=-g -Wno-char-subscripts -O
#SYS_LIBS= -ldl
#PLATFORM_FEATURES= -DUSE_STRLWR=1 -D__APPLE__=1 -DOSX=1
# Solaris
#SYS_LIBS= -ldl -lc
#Osuf=o
#SOsuf=so
#EXE_EXT=
#LD = ld
#LDFLAGS = -G -Bsymbolic -z text
#LIBPREFIX = lib
#OUT = -o $@
FEATURES = $(PLATFORM_FEATURES) -DUSE_DL=1 -DUSE_MATH=1 -DUSE_ASCII_NAMES=0
OBJS = scheme.$(Osuf) dynload.$(Osuf)
LIBTARGET = $(LIBPREFIX)tinyscheme.$(SOsuf)
STATICLIBTARGET = $(LIBPREFIX)tinyscheme.$(LIBsuf)
all: $(LIBTARGET) $(STATICLIBTARGET) scheme$(EXE_EXT)
%.$(Osuf): %.c
$(CC) -I. -c $(DEBUG) $(FEATURES) $(DL_FLAGS) $<
$(LIBTARGET): $(OBJS)
$(LD) $(LDFLAGS) $(OUT) $(OBJS) $(SYS_LIBS)
scheme$(EXE_EXT): $(OBJS)
$(CC) -o $@ $(DEBUG) $(OBJS) $(SYS_LIBS)
$(STATICLIBTARGET): $(OBJS)
$(AR) $@ $(OBJS)
$(OBJS): scheme.h scheme-private.h opdefines.h
dynload.$(Osuf): dynload.h
clean:
$(RM) $(OBJS) $(LIBTARGET) $(STATICLIBTARGET) scheme$(EXE_EXT)
$(RM) tinyscheme.ilk tinyscheme.map tinyscheme.pdb tinyscheme.exp
$(RM) scheme.ilk scheme.map scheme.pdb scheme.lib scheme.exp
$(RM) *~
TAGS_SRCS = scheme.h scheme.c dynload.h dynload.c
tags: TAGS
TAGS: $(TAGS_SRCS)
etags $(TAGS_SRCS)