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
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
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 mkdir
-p _build
/binaries || true
83 cp tools
/_build
/binaries
/* _build
/binaries
86 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
87 @if
[ -f errors
]; then cat errors
; echo
"Note: addons are expected not to build the libs or headers are missing"; rm errors
; fi
90 mkdir
-p _build || true
91 mkdir
-p _build
/dll || true
92 $(LINKDLL
) $(DLL_COMMAND
) $(LINKDLLOUTFLAG
)_build
/dll
/libiovmall.
$(DLL_SUFFIX
) libs
/*/_build
/$(VMALL
)objs
/*.o
$(LFLAGS
) $(DLL_EXTRA_LIBS
)
93 mkdir
-p _build
/lib || true
94 $(AR
) $(ARFLAGS
) $(AROUTFLAG
)_build
/lib
/libiovmall.a\
95 libs
/*/_build
/$(VMALL
)objs
/*.o
96 mkdir
-p _build
/headers || true
97 cp libs
/*/_build
/headers
/* _build
/headers
99 # Unlink the io binary before copying so running Io processes will keep running
102 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
103 mkdir
-p
$(INSTALL_PREFIX
)/lib || true
104 rm -f
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
105 cp _build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin || true
106 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
107 cp _build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
108 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
) || true
109 cp _build
/dll
/* $(INSTALL_PREFIX
)/lib || true
110 cp _build
/lib
/* $(INSTALL_PREFIX
)/lib || true
111 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
112 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
113 cp
-fR addons
$(INSTALL_PREFIX
)/lib
/io
114 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
117 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
118 ln
-sf
`pwd`/_build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
119 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
120 ln
-sf
`pwd`/_build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
121 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
122 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_PREFIX
)/lib
123 ln
-sf
`pwd`/_build
/lib
/* $(INSTALL_PREFIX
)/lib
124 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
125 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
126 ln
-s
`pwd`/addons
$(INSTALL_PREFIX
)/lib
/io
/addons
127 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
130 rm -rf
$(INSTALL_PREFIX
)/lib
/io
131 rm $(INSTALL_PREFIX
)/bin
/io
132 rm $(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
133 rm $(INSTALL_PREFIX
)/lib
/libiovmall.
*
136 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io docs
139 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io cleanDocs
142 for
dir in
$(libs
); do \
143 $(MAKE
) -C libs
/$$dir clean; \
146 cd tools
; $(MAKE
) cleanDocs
; cd ..
147 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
clean || true
148 -rm -f IoBindingsInit.
*
150 -rm -rf projects
/osx
/build
151 -rm -rf projects
/osxvm
/build
152 cd tools
; $(MAKE
) clean
158 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io runUnitTests
166 echo
"#define IO_VERSION_NUMBER "$(shell date
+'%Y%m%d') > libs
/iovm
/source
/IoVersion.h
167 git add libs
/iovm
/source
/IoVersion.h
168 git commit
-q
--no-verify
-m
"setting version string for release"
169 git archive
--format
=tar --prefix=Io-
$(date
)/ HEAD | gzip
> Io-
$(date
).
tar.gz
170 ls
-al Io-
$(date
).
tar.gz
174 echo
"#define IO_VERSION_NUMBER "$(shell date
+'%Y%m%d') > libs
/iovm
/source
/IoVersion.h
175 git add libs
/iovm
/source
/IoVersion.h
176 git commit
-q
--no-verify
-m
"setting version string for release"
177 git archive
--format
=zip
--prefix=Io-
$(date
)/ HEAD
> Io-
$(date
).zip
178 ls
-al Io-
$(date
).zip
184 ls
-1 libs
/iovm
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " iovm"'
185 ls
-1 libs
/basekit
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " basekit"'
186 ls
-1 libs
/coroutine
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " libcoroutine"'
187 ls
-1 libs
/*/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " total in core"'
190 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io aptget
193 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io emerge
196 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io port
199 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io urpmi
202 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
-a
$@