forked from higepon/mosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.mona
90 lines (63 loc) · 2.89 KB
/
Makefile.mona
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
# -*- Mode: Makefile ; Coding: utf-8 -*-
SRCTOP=../..
include $(SRCTOP)/Makefile.inc
TARGET = MOSH
INSTDIR = $(BINDIR)/APPS
INSTDIR = $(BINDIR)/APPS/$(TARGET).APP
include mona/Makefile.src.inc
include mona/Makefile.gc.inc
include mona/Makefile.onig.inc
ADDTARGETDEP = $(ONIG_DIR) $(BOEHM_GC_DIR)
ADDLINKDEP = $(ONIG_OBJECTS) $(GC_OBJECTS)
ADDLINK = $(ONIG_OBJECTS) $(GC_OBJECTS) -lssl-imp -lcrypto-imp -lgmp-imp -l monalibc-imp --enable-auto-import
ADDCFLAGS = -D USE_BOEHM_GC -D PACKAGE_VERSION="\"0.2.6\"" -DMOSH_LIB_PATH="\"/LIBS/MOSH/\"" -U__CYGWIN32__ -mno-stack-arg-probe -DDEBUG_VERSION -DLINE_FEED_CODE_LF=1 -O3 -momit-leaf-frame-pointer -fomit-frame-pointer -march=i686 #-msse2 -mfpmath=sse
ADDINCLUDE = -I ./extlibs/onig-5.9.2 -I $(BOEHM_GC_DIR)/include
CLEANFILES = $(ONIG_OBJECTS) $(GC_OBJECTS) .BOOT
ONIG_OBJECTS = $(ONIG_SOURCES:.c=.o)
INSTFILES = MOSH.map mona/all-tests.scm
top_srcdir = "."
include $(SHAREDIR)/configs/monapi-exe.inc
$(ONIG_OBJECTS) : $(ONIG_DIR)/config.h
$(ONIG_DIR)/config.h : mona/onig_config.h
cp $< $@
.PHONY : gen
GEN_FILES = src/Instruction.h src/labels.cpp src/Object-accessors.h src/OSConstants.h src/Reader.tab.cpp src/NumberReader.tab.cpp src/cprocedures.cpp
gen: .BOOT $(GEN_FILES)
$(SOURCES): $(GEN_FILES)
.BOOT:
@if [ ! -f $@ ]; then touch $@; ./gen-git-build.sh; fi
src/Instruction.h: src/instruction.scm
mosh $(top_srcdir)/misc/scripts/gen-insn.scm $< $@
src/main.cpp: src/psyntax_mosh_image.cpp src/baselib.h src/match.h
src/labels.cpp: src/instruction.scm
mosh $(top_srcdir)/misc/scripts/gen-label.scm $< $@
src/cprocedures.cpp: boot/free-vars-decl.scm
mosh $(top_srcdir)/misc/scripts/gen-cproc.scm $< $@
src/all-tests.scm: src/test-data.scm
(cd $(top_srcdir) && mosh -5 misc/scripts/gen-test.scm src/test-data.scm src/all-tests.scm)
# echo 'run -5 misc/scripts/gen-test.scm test-data.scm all-tests.scm ' | gdb ./mosh
src/Object-accessors.h: src/accessors.scm
(cd $(top_srcdir) && mosh misc/scripts/gen-accessors.scm) > $@
src/OSConstants.h: src/os-constants.scm
(cd $(top_srcdir) && mosh misc/scripts/gen-os-constants.scm) > $@
src/Reader.tab.cpp : src/Reader.y
bison -d $< -o $@
src/NumberReader.tab.cpp : src/NumberReader.y
bison -p "number_yy" -d $< -o $@
src/Scanner.cpp : src/scanner.re src/Reader.tab.hpp
re2c -u $< > $@ # -d is debug option
src/NumberScanner.cpp : src/NumberScanner.re src/NumberReader.tab.hpp
re2c -cu $< > $@ # -d is debug option
install:all
mkdir -p $(INSTDIR)
cp -fpr tests $(INSTDIR)
rm -rf $(INSTDIR)/r6rs-test-suite
mv $(INSTDIR)/tests/r6rs-test-suite $(INSTDIR)/ # Avoid too long path longer than 64
$(INSTALL) $(TARGET).EXE $(INSTFILES) $(INSTDIR)
mkdir -p $(BINDIR)/LIBS/MOSH/lib
cp -pr ./lib/ $(BINDIR)/LIBS/MOSH/lib/
(cd mona && cp -pr ./bin $(BINDIR)/LIBS/MOSH/)
depend dependencies:
$(CXX) -MM $(INCLUDE) $(CXXFLAGS) $(SOURCES) >> dependencies
sed -i 's/^.*:/src\/&/' ./dependencies
-include dependencies