forked from HaxeFoundation/haxe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.win
52 lines (41 loc) · 1.69 KB
/
Makefile.win
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
include Makefile
OUTPUT=haxe.exe
EXTENSION=.exe
PACKAGE_SRC_EXTENSION=.zip
OCAMLOPT=ocamlopt.opt
kill:
-@taskkill /F /IM haxe.exe
# allow Ocaml/Mingw as well
NATIVE_LIBS += -I "c:/program files/mingw/lib/"
# use make WODI=wodi32 -f Makefile.win to build using WODI 32bit
ifdef WODI
NATIVE_LIBS += -I "/opt/${WODI}/lib"
endif
# use make MSVC=1 -f Makefile.win to build for OCaml/MSVC
ifeq (${MSVC}, 1)
NATIVE_LIBS = shell32.lib libs/extc/extc_stubs.obj libs/extc/process_stubs.obj libs/extc/zlib/zlib.lib libs/objsize/c_objsize.obj
endif
ifeq (${MSVC_OUTPUT}, 1)
FILTER=sed 's/File "\([^"]\+\)", line \([0-9]\+\), \(.*\)/\1(\2): \3/' tmp.cmi
endif
ifeq (${FD_OUTPUT}, 1)
FILTER=sed '/File/{ N; s/File "\([^"]\+\)", line \([0-9]\+\), characters \([0-9-]\+\):[\r\n]*\(.*\)/\1:\2: characters \3 : \4/ }' tmp.cmi
endif
ifdef FILTER
CC_CMD=($(OCAMLOPT) $(CFLAGS) -c $< 2>tmp.cmi && $(FILTER)) || ($(FILTER) && exit 1)
CC_PARSER_CMD=($(OCAMLOPT) -pp camlp4o $(CFLAGS) -c parser.ml 2>tmp.cmi && $(FILTER)) || ($(FILTER) && exit 1)
endif
package_bin:
mkdir -p out
rm -rf $(PACKAGE_FILE_NAME) $(PACKAGE_FILE_NAME).zip temp.zip
# Copy the package contents to $(PACKAGE_FILE_NAME)
# Using poor man's cp (zip then unzip), because cp in cygwin is quite broken
mkdir -p $(PACKAGE_FILE_NAME)
7za a -y -tzip -mx0 temp.zip $(OUTPUT) haxelib$(EXTENSION) std > log.txt || type log.txt
cd extra && 7za a -y -tzip -mx0 ../temp.zip LICENSE.txt CONTRIB.txt CHANGES.txt > log.txt || type log.txt
7za x -y temp.zip -o$(PACKAGE_FILE_NAME) > log.txt || type log.txt
rm temp.zip
# archive
7za a -r -tzip out/$(PACKAGE_FILE_NAME)_bin.zip $(PACKAGE_FILE_NAME) > log.txt || type log.txt
rm -r $(PACKAGE_FILE_NAME)
rm log.txt extra/log.txt