1 INSTALL_PREFIX ?
= /usr
/local
3 SYS ?
= $(shell uname
-s
)
5 NEEDS_DL
:= Darwin Linux SunOS syllable
6 ifneq (,$(findstring $(SYS
),$(NEEDS_DL
)))
10 NEEDS_M
:= FreeBSD Linux NetBSD DragonFly
11 ifneq (,$(findstring $(SYS
),$(NEEDS_M
)))
15 #NEEDS_PTHREAD := FreeBSD Linux NetBSD
16 #ifneq (,$(findstring $(SYS),$(NEEDS_PTHREAD)))
21 DLL_COMMAND
:= -shared
-Wl
,-soname
="libiovmall.so"
37 DLL_COMMAND
:= -dynamiclib
38 FLAT_NAMESPACE
:= -flat_namespace
41 ifneq (,$(findstring CYGW
,$(SYS
)))
46 ifneq (,$(findstring MINGW
,$(SYS
)))
51 ifneq (,$(findstring Windows
,$(SYS
)))
54 LINKDLLOUTFLAG
:=-out
:
56 DLL_COMMAND
:= -dll
-debug
/INCREMENTAL
:NO
-subsystem
:CONSOLE
57 DLL_EXTRA_LIBS
:= ws2_32.lib shell32.lib
66 ###########################
68 date
:= $(shell date
+'%Y-%m-%d')
70 #libs := $(shell ls libs)
71 libs
:= basekit coroutine garbagecollector iovm
76 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) addons
/$(addon
)/tests
/run.io
79 for
dir in
$(libs
); do INSTALL_PREFIX
=$(INSTALL_PREFIX
) $(MAKE
) -C libs
/$$dir; done
82 ifneq (,$(findstring Windows
,$(SYS
)))
83 mt.exe
-manifest tools
/_build
/binaries
/io.exe.manifest
-outputresource
:tools
/_build
/binaries
/io.exe
84 rm tools
/_build
/binaries
/io.exe.manifest
85 mt.exe
-manifest tools
/_build
/binaries
/io_static.exe.manifest
-outputresource
:tools
/_build
/binaries
/io_static.exe
86 rm tools
/_build
/binaries
/io_static.exe.manifest
88 mkdir
-p _build
/binaries || true
89 cp tools
/_build
/binaries
/* _build
/binaries
92 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
93 @if
[ -f errors
]; then cat errors
; echo
; echo
"Note: addons do not to build when libs or headers are missing"; echo
; rm errors
; fi
96 mkdir
-p _build || true
97 mkdir
-p _build
/dll || true
98 $(LINKDLL
) $(DLL_COMMAND
) $(LINKDLLOUTFLAG
)_build
/dll
/libiovmall.
$(DLL_SUFFIX
) libs
/*/_build
/$(VMALL
)objs
/*.o
$(LFLAGS
) $(DLL_EXTRA_LIBS
)
99 ifneq (,$(findstring Windows
,$(SYS
)))
100 mt.exe
-manifest _build
/dll
/libiovmall.dll.manifest
-outputresource
:_build
/dll
/libiovmall.dll
101 rm _build
/dll
/libiovmall.dll.manifest
103 mkdir
-p _build
/lib || true
104 $(AR
) $(ARFLAGS
) $(AROUTFLAG
)_build
/lib
/libiovmall.a\
105 libs
/*/_build
/$(VMALL
)objs
/*.o
106 mkdir
-p _build
/headers || true
107 cp libs
/*/_build
/headers
/* _build
/headers
109 # Unlink the io binary before copying so running Io processes will keep running
112 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
113 mkdir
-p
$(INSTALL_PREFIX
)/lib || true
114 rm -f
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
115 cp _build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin || true
116 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
117 cp _build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin || true
118 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
) || true
119 cp _build
/dll
/* $(INSTALL_PREFIX
)/lib || true
120 cp _build
/dll
/* $(INSTALL_PREFIX
)/bin || true
121 cp _build
/lib
/* $(INSTALL_PREFIX
)/lib || true
122 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
123 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
124 cp
-fR addons
$(INSTALL_PREFIX
)/lib
/io
125 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
128 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
129 mkdir
-p
$(INSTALL_PREFIX
)/lib || true
130 ln
-sf
`pwd`/_build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
131 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
132 ln
-sf
`pwd`/_build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
133 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
134 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_PREFIX
)/lib
135 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_PREFIX
)/bin
136 ln
-sf
`pwd`/_build
/lib
/* $(INSTALL_PREFIX
)/lib
137 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
138 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
139 ln
-s
`pwd`/addons
$(INSTALL_PREFIX
)/lib
/io
/addons
140 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
143 rm -rf
$(INSTALL_PREFIX
)/lib
/io
144 rm $(INSTALL_PREFIX
)/bin
/io
145 rm $(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
146 rm $(INSTALL_PREFIX
)/bin
/libiovmall.
*
147 rm $(INSTALL_PREFIX
)/lib
/libiovmall.
*
150 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io docs
153 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io cleanDocs
156 for
dir in
$(libs
); do \
157 $(MAKE
) -C libs
/$$dir clean; \
160 cd tools
; $(MAKE
) cleanDocs
; cd ..
161 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
clean || true
162 -rm -f IoBindingsInit.
*
164 -rm -rf projects
/osx
/build
165 -rm -rf projects
/osxvm
/build
166 $(MAKE
) -C tools
clean
172 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io runUnitTests
180 echo
"#define IO_VERSION_NUMBER "$(shell date
+'%Y%m%d') > libs
/iovm
/source
/IoVersion.h
181 git add libs
/iovm
/source
/IoVersion.h | true
182 git commit
-q
--no-verify
-m
"setting version string for release" | true
183 git archive
--format
=tar --prefix=Io-
$(date
)/ HEAD | gzip
> Io-
$(date
).
tar.gz
184 ls
-al Io-
$(date
).
tar.gz
187 ls
-1 libs
/iovm
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " iovm"'
188 ls
-1 libs
/basekit
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " basekit"'
189 ls
-1 libs
/coroutine
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " libcoroutine"'
190 ls
-1 libs
/*/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " total in core"'
193 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io aptget
196 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io emerge
199 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io port
202 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io urpmi
205 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
-a
$@