1 INSTALL_PREFIX ?
= /usr
/local
3 SYS ?
= $(shell uname
-s
)
5 NEEDS_DL
:= Darwin Linux SunOS syllable
6 ifneq (,$(findstring $(SYS
),$(NEEDS_DL
)))
11 NEEDS_M
:= FreeBSD Linux NetBSD
12 ifneq (,$(findstring $(SYS
),$(NEEDS_M
)))
16 #NEEDS_PTHREAD := FreeBSD Linux NetBSD
17 #ifneq (,$(findstring $(SYS),$(NEEDS_PTHREAD)))
22 DLL_COMMAND
:= -shared
-Wl
,-soname
="libiovmall.so"
38 DLL_COMMAND
:= -dynamiclib
39 FLAT_NAMESPACE
:= -flat_namespace
42 ifneq (,$(findstring CYGW
,$(SYS
)))
47 ifneq (,$(findstring MINGW
,$(SYS
)))
52 ifneq (,$(findstring Windows
,$(SYS
)))
55 LINKDLLOUTFLAG
:=-out
:
57 DLL_COMMAND
:= -dll
-debug
/INCREMENTAL
:NO
-subsystem
:CONSOLE
58 DLL_EXTRA_LIBS
:= ws2_32.lib
67 ###########################
69 date
:= $(shell date
+'%Y-%m-%d')
71 #libs := $(shell ls libs)
72 libs
:= basekit coroutine garbagecollector iovm
77 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) addons
/$(addon
)/tests
/run.io
80 $(MAKE
) -C tools
/editlib_test
clean
81 $(MAKE
) -C tools
/editlib_test || true
82 for
dir in
$(libs
); do INSTALL_PREFIX
=$(INSTALL_PREFIX
) $(MAKE
) -C libs
/$$dir; done
85 ifneq (,$(findstring Windows
,$(SYS
)))
86 mt.exe
-manifest tools
/_build
/binaries
/io.exe.manifest
-outputresource
:tools
/_build
/binaries
/io.exe
87 rm tools
/_build
/binaries
/io.exe.manifest
88 mt.exe
-manifest tools
/_build
/binaries
/io_static.exe.manifest
-outputresource
:tools
/_build
/binaries
/io_static.exe
89 rm tools
/_build
/binaries
/io_static.exe.manifest
91 mkdir
-p _build
/binaries || true
92 cp tools
/_build
/binaries
/* _build
/binaries
93 @
$(MAKE
) -s
-C tools
/editlib_test warn
96 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
97 @
$(MAKE
) -s
-C tools
/editlib_test warn
98 @if
[ -f errors
]; then cat errors
; echo
; echo
"Note: addons do not to build when libs or headers are missing"; echo
; rm errors
; fi
101 mkdir
-p _build || true
102 mkdir
-p _build
/dll || true
103 $(LINKDLL
) $(DLL_COMMAND
) $(LINKDLLOUTFLAG
)_build
/dll
/libiovmall.
$(DLL_SUFFIX
) libs
/*/_build
/$(VMALL
)objs
/*.o
$(LFLAGS
) $(DLL_EXTRA_LIBS
)
104 ifneq (,$(findstring Windows
,$(SYS
)))
105 mt.exe
-manifest _build
/dll
/libiovmall.dll.manifest
-outputresource
:_build
/dll
/libiovmall.dll
106 rm _build
/dll
/libiovmall.dll.manifest
108 mkdir
-p _build
/lib || true
109 $(AR
) $(ARFLAGS
) $(AROUTFLAG
)_build
/lib
/libiovmall.a\
110 libs
/*/_build
/$(VMALL
)objs
/*.o
111 mkdir
-p _build
/headers || true
112 cp libs
/*/_build
/headers
/* _build
/headers
114 # Unlink the io binary before copying so running Io processes will keep running
117 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
118 mkdir
-p
$(INSTALL_PREFIX
)/lib || true
119 rm -f
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
120 cp _build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin || true
121 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
122 cp _build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
123 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
) || true
124 cp _build
/dll
/* $(INSTALL_PREFIX
)/lib || true
125 cp _build
/dll
/* $(INSTALL_PREFIX
)/bin || true
126 cp _build
/lib
/* $(INSTALL_PREFIX
)/lib || true
127 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
128 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
129 cp
-fR addons
$(INSTALL_PREFIX
)/lib
/io
130 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
133 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
134 ln
-sf
`pwd`/_build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
135 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
136 ln
-sf
`pwd`/_build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
137 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
138 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_PREFIX
)/lib
139 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_PREFIX
)/bin
140 ln
-sf
`pwd`/_build
/lib
/* $(INSTALL_PREFIX
)/lib
141 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
142 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
143 ln
-s
`pwd`/addons
$(INSTALL_PREFIX
)/lib
/io
/addons
144 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
147 rm -rf
$(INSTALL_PREFIX
)/lib
/io
148 rm $(INSTALL_PREFIX
)/bin
/io
149 rm $(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
150 rm $(INSTALL_PREFIX
)/bin
/libiovmall.
*
151 rm $(INSTALL_PREFIX
)/lib
/libiovmall.
*
154 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io docs
157 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io cleanDocs
160 for
dir in
$(libs
); do \
161 $(MAKE
) -C libs
/$$dir clean; \
164 cd tools
; $(MAKE
) cleanDocs
; cd ..
165 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
clean || true
166 -rm -f IoBindingsInit.
*
168 -rm -rf projects
/osx
/build
169 -rm -rf projects
/osxvm
/build
170 $(MAKE
) -C tools
clean
171 $(MAKE
) -C tools
/editlib_test
clean
177 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io runUnitTests
185 echo
"#define IO_VERSION_NUMBER "$(shell date
+'%Y%m%d') > libs
/iovm
/source
/IoVersion.h
186 #git add libs/iovm/source/IoVersion.h
187 #git commit -q --no-verify -m "setting version string for release"
188 git archive
--format
=tar --prefix=Io-
$(date
)/ HEAD | gzip
> Io-
$(date
).
tar.gz
189 ls
-al Io-
$(date
).
tar.gz
192 ls
-1 libs
/iovm
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " iovm"'
193 ls
-1 libs
/basekit
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " basekit"'
194 ls
-1 libs
/coroutine
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " libcoroutine"'
195 ls
-1 libs
/*/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " total in core"'
198 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io aptget
201 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io emerge
204 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io port
207 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io urpmi
210 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
-a
$@