1 INSTALL_PREFIX ?
= /usr
/local
2 INSTALL_LIBDIR ?
= $(INSTALL_PREFIX
)/lib
4 SYS ?
= $(shell uname
-s
)
6 NEEDS_DL
:= Darwin Linux SunOS syllable
7 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 for
dir in
$(libs
); do INSTALL_PREFIX
=$(INSTALL_PREFIX
) $(MAKE
) -C libs
/$$dir; done
83 mkdir
-p _build
/binaries || true
84 cp tools
/_build
/binaries
/* _build
/binaries
87 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
88 @if
[ -f errors
]; then cat errors
; rm errors
; fi
91 mkdir
-p _build || true
92 mkdir
-p _build
/dll || true
93 $(LINKDLL
) $(DLL_COMMAND
) $(LINKDLLOUTFLAG
)_build
/dll
/libiovmall.
$(DLL_SUFFIX
) libs
/*/_build
/$(VMALL
)objs
/*.o
$(LFLAGS
) $(DLL_EXTRA_LIBS
)
94 mkdir
-p _build
/lib || true
95 $(AR
) $(ARFLAGS
) $(AROUTFLAG
)_build
/lib
/libiovmall.a\
96 libs
/*/_build
/$(VMALL
)objs
/*.o
97 mkdir
-p _build
/headers || true
98 cp libs
/*/_build
/headers
/* _build
/headers
100 # Unlink the io binary before copying so running Io processes will keep running
103 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
104 mkdir
-p
$(INSTALL_LIBDIR
) || true
105 rm -f
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
106 cp _build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin || true
107 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
108 cp _build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
109 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
) || true
110 cp _build
/dll
/* $(INSTALL_LIBDIR
) || true
111 cp _build
/lib
/* $(INSTALL_LIBDIR
) || true
112 rm -rf
$(INSTALL_LIBDIR
)/io || true
113 mkdir
-p
$(INSTALL_LIBDIR
)/io || true
114 cp
-fR addons
$(INSTALL_LIBDIR
)/io
115 chmod
-R ugo
+rX
$(INSTALL_LIBDIR
)/io
118 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
119 ln
-sf
`pwd`/_build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
120 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
121 ln
-sf
`pwd`/_build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
122 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
123 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_LIBDIR
)
124 ln
-sf
`pwd`/_build
/lib
/* $(INSTALL_LIBDIR
)
125 rm -rf
$(INSTALL_LIBDIR
)/io || true
126 mkdir
-p
$(INSTALL_LIBDIR
)/io || true
127 ln
-s
`pwd`/addons
$(INSTALL_LIBDIR
)/io
/addons
128 chmod
-R ugo
+rX
$(INSTALL_LIBDIR
)/io
131 rm -rf
$(INSTALL_LIBDIR
)/io
132 rm $(INSTALL_PREFIX
)/bin
/io
133 rm $(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
134 rm $(INSTALL_LIBDIR
)/libiovmall.
*
137 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io docs
140 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io cleanDocs
143 for
dir in
$(libs
); do \
144 $(MAKE
) -C libs
/$$dir clean; \
147 cd tools
; $(MAKE
) cleanDocs
; cd ..
148 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
clean || true
149 -rm -f IoBindingsInit.
*
151 -rm -rf projects
/osx
/build
152 -rm -rf projects
/osxvm
/build
153 cd tools
; $(MAKE
) clean
159 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io runUnitTests
167 echo
"#define IO_VERSION_NUMBER "$(shell date
+'%Y%m%d') > libs
/iovm
/source
/IoVersion.h
168 git add libs
/iovm
/source
/IoVersion.h
169 git commit
-q
--no-verify
-m
"setting version string for release"
170 git archive
--format
=tar --prefix=Io-
$(date
)/ HEAD | gzip
> Io-
$(date
).
tar.gz
171 ls
-al Io-
$(date
).
tar.gz
175 echo
"#define IO_VERSION_NUMBER "$(shell date
+'%Y%m%d') > libs
/iovm
/source
/IoVersion.h
176 git add libs
/iovm
/source
/IoVersion.h
177 git commit
-q
--no-verify
-m
"setting version string for release"
178 git archive
--format
=zip
--prefix=Io-
$(date
)/ HEAD
> Io-
$(date
).zip
179 ls
-al Io-
$(date
).zip
185 ls
-1 libs
/iovm
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " iovm"'
186 ls
-1 libs
/basekit
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " basekit"'
187 ls
-1 libs
/coroutine
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " libcoroutine"'
188 ls
-1 libs
/*/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " total in core"'
191 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io aptget
194 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io emerge
197 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io port
200 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io urpmi
203 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
-a
$@