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 mkdir
-p _build
/binaries || true
86 cp tools
/_build
/binaries
/* _build
/binaries
87 @
$(MAKE
) -s
-C tools
/editlib_test warn
90 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
91 @
$(MAKE
) -s
-C tools
/editlib_test warn
92 @if
[ -f errors
]; then cat errors
; echo
; echo
"Note: addons do not to build when libs or headers are missing"; echo
; rm errors
; fi
95 mkdir
-p _build || true
96 mkdir
-p _build
/dll || true
97 $(LINKDLL
) $(DLL_COMMAND
) $(LINKDLLOUTFLAG
)_build
/dll
/libiovmall.
$(DLL_SUFFIX
) libs
/*/_build
/$(VMALL
)objs
/*.o
$(LFLAGS
) $(DLL_EXTRA_LIBS
)
98 mkdir
-p _build
/lib || true
99 $(AR
) $(ARFLAGS
) $(AROUTFLAG
)_build
/lib
/libiovmall.a\
100 libs
/*/_build
/$(VMALL
)objs
/*.o
101 mkdir
-p _build
/headers || true
102 cp libs
/*/_build
/headers
/* _build
/headers
104 # Unlink the io binary before copying so running Io processes will keep running
107 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
108 mkdir
-p
$(INSTALL_PREFIX
)/lib || true
109 rm -f
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
110 cp _build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin || true
111 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
112 cp _build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
113 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
) || true
114 cp _build
/dll
/* $(INSTALL_PREFIX
)/lib || true
115 cp _build
/dll
/* $(INSTALL_PREFIX
)/bin || true
116 cp _build
/lib
/* $(INSTALL_PREFIX
)/lib || true
117 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
118 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
119 cp
-fR addons
$(INSTALL_PREFIX
)/lib
/io
120 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
123 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
124 ln
-sf
`pwd`/_build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
125 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
126 ln
-sf
`pwd`/_build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
127 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
128 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_PREFIX
)/lib
129 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_PREFIX
)/bin
130 ln
-sf
`pwd`/_build
/lib
/* $(INSTALL_PREFIX
)/lib
131 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
132 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
133 ln
-s
`pwd`/addons
$(INSTALL_PREFIX
)/lib
/io
/addons
134 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
137 rm -rf
$(INSTALL_PREFIX
)/lib
/io
138 rm $(INSTALL_PREFIX
)/bin
/io
139 rm $(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
140 rm $(INSTALL_PREFIX
)/bin
/libiovmall.
*
141 rm $(INSTALL_PREFIX
)/lib
/libiovmall.
*
144 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io docs
147 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io cleanDocs
150 for
dir in
$(libs
); do \
151 $(MAKE
) -C libs
/$$dir clean; \
154 cd tools
; $(MAKE
) cleanDocs
; cd ..
155 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
clean || true
156 -rm -f IoBindingsInit.
*
158 -rm -rf projects
/osx
/build
159 -rm -rf projects
/osxvm
/build
160 $(MAKE
) -C tools
clean
161 $(MAKE
) -C tools
/editlib_test
clean
167 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io runUnitTests
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
=tar --prefix=Io-
$(date
)/ HEAD | gzip
> Io-
$(date
).
tar.gz
179 ls
-al Io-
$(date
).
tar.gz
182 ls
-1 libs
/iovm
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " iovm"'
183 ls
-1 libs
/basekit
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " basekit"'
184 ls
-1 libs
/coroutine
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " libcoroutine"'
185 ls
-1 libs
/*/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " total in core"'
188 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io aptget
191 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io emerge
194 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io port
197 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io urpmi
200 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
-a
$@