-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
91 lines (66 loc) · 2.5 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
# $Id:$
PREFIX = /usr/local
CC = gcc
# for product build. (use BoehmGC)
CFLAGS = -Wall -O3 -c -g -DHAS_GCACHE
#CFLAGS = -Wall -c -g -DHAS_GCACHE
INCLUDE = -I/usr/local/include -I.
LIB = -L/usr/local/lib -lgc -lpthread -lonig -lpcl -lgmp
# for memory debuging build.
#CFLAGS = -c -g -DPROF -DHAS_GCACHE
#INCLUDE = -I/usr/local/include -I.
#LIB = -L/usr/local/lib -lonig -lpcl -lgmp
# for profiling build.
#CFLAGS = -c -g -pg -DPROF -DHAS_GCACHE
#INCLUDE = -I/usr/local/include -I.
#LIB = -pg -L/usr/local/lib -lonig -lpcl -lgmp
HDRS = bulk.h cell.h array.h error.h hash.h interp.h parser.h \
toy.h types.h config.h global.h cstack.h
SRCS = bulk.c cell.c array.c hash.c list.c parser.c types.c \
eval.c interp.c commands.c methods.c global.c cstack.c
OBJS = bulk.o cell.o array.o hash.o list.o parser.o types.o \
eval.o interp.o commands.o methods.o global.o cstack.o
all: perfumesh
install:
if [ ! -d $(PREFIX)/lib/perfume ]; then mkdir $(PREFIX)/lib/perfume; fi
if [ ! -d $(PREFIX)/lib/perfume/lib ]; then mkdir $(PREFIX)/lib/perfume/lib; fi
install -m 755 perfumesh $(PREFIX)/bin
install -m 644 setup.prfm $(PREFIX)/lib/perfume
install -m 644 lib/*.prfm $(PREFIX)/lib/perfume/lib
perfumesh: $(OBJS) toysh.o
$(CC) $(OBJS) toysh.o $(LIB) -o perfumesh
toysh.o: $(SRCS) $(HDRS) toysh.c
$(CC) $(CFLAGS) $(INCLUDE) toysh.c -o toysh.o
cell.o: cell.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) cell.c -o cell.o
array.o: array.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) array.c -o array.o
list.o: list.c
$(CC) $(CFLAGS) $(INCLUDE) list.c -o list.o
hash.o: hash.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) hash.c -o hash.o
bulk.o: bulk.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) bulk.c -o bulk.o
types.o: types.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) types.c -o types.o
parser.o: parser.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) parser.c -o parser.o
interp.o: interp.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) interp.c -o interp.o
eval.o: eval.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) eval.c -o eval.o
commands.o: commands.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) commands.c -o commands.o
methods.o: methods.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) methods.c -o methods.o
global.o: global.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) global.c -o global.o
cstack.o: cstack.c $(HDRS)
$(CC) $(CFLAGS) $(INCLUDE) cstack.c -o cstack.o
config.h: config.h.in
sed -e s%@PREFIX@%$(PREFIX)%g \
-e s%@VERSION@%`head -1 RELEASE | awk '{print $$3}'`%g \
< config.h.in > config.h
clean:
rm -f *.o perfumesh *~ lib/*~ *core* *.gmon config.h tests/setup.prfm
#eof