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
; 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
,lib
} || true
103 rm -f
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
104 cp _build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin || true
105 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
$(BINARY_SUFFIX
)
106 cp _build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
107 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
) || true
108 cp _build
/dll
/* $(INSTALL_PREFIX
)/lib || true
109 cp _build
/lib
/* $(INSTALL_PREFIX
)/lib || true
110 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
111 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
112 cp
-fR addons
$(INSTALL_PREFIX
)/lib
/io
113 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
116 mkdir
-p
$(INSTALL_PREFIX
)/bin || true
117 ln
-sf
`pwd`/_build
/binaries
/io
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
118 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io
119 ln
-sf
`pwd`/_build
/binaries
/io_static
$(BINARY_SUFFIX
) $(INSTALL_PREFIX
)/bin
120 chmod ugo
+rx
$(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
121 ln
-sf
`pwd`/_build
/dll
/* $(INSTALL_PREFIX
)/lib
122 ln
-sf
`pwd`/_build
/lib
/* $(INSTALL_PREFIX
)/lib
123 rm -rf
$(INSTALL_PREFIX
)/lib
/io || true
124 mkdir
-p
$(INSTALL_PREFIX
)/lib
/io || true
125 ln
-s
`pwd`/addons
$(INSTALL_PREFIX
)/lib
/io
/addons
126 chmod
-R ugo
+rX
$(INSTALL_PREFIX
)/lib
/io
129 rm -rf
$(INSTALL_PREFIX
)/lib
/io
130 rm $(INSTALL_PREFIX
)/bin
/io
131 rm $(INSTALL_PREFIX
)/bin
/io_static
$(BINARY_SUFFIX
)
132 rm $(INSTALL_PREFIX
)/lib
/libiovmall.
*
135 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io docs
138 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io cleanDocs
141 for
dir in
$(libs
); do \
142 $(MAKE
) -C libs
/$$dir clean; \
145 cd tools
; $(MAKE
) cleanDocs
; cd ..
146 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
clean || true
147 -rm -f IoBindingsInit.
*
149 -rm -rf projects
/osx
/build
150 -rm -rf projects
/osxvm
/build
151 cd tools
; $(MAKE
) clean
157 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io runUnitTests
165 echo
"#define IO_VERSION_NUMBER "$(shell date
+'%Y%m%d') > libs
/iovm
/source
/IoVersion.h
166 #git add libs/iovm/source/IoVersion.h
167 #git commit -q --no-verify -m "setting version string for release"
168 git archive
--format
=tar --prefix=Io-
$(date
)/ HEAD | gzip
> Io-
$(date
).
tar.gz
169 ls
-al Io-
$(date
).
tar.gz
172 ls
-1 libs
/iovm
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " iovm"'
173 ls
-1 libs
/basekit
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " basekit"'
174 ls
-1 libs
/coroutine
/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " libcoroutine"'
175 ls
-1 libs
/*/source
/*.c | io
-e
'File standardInput readLines map(asFile contents occurancesOfSeq(";")) sum .. " total in core"'
178 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io aptget
181 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io emerge
184 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io port
187 _build
/binaries
/io
$(BINARY_SUFFIX
) build.io urpmi
190 .
/_build
/binaries
/io_static
$(BINARY_SUFFIX
) build.io
-a
$@