Skip to content

Commit 20f26b5

Browse files
committed
Makefile: Accept $(MINGW) instead of $(INCS)
1 parent 32294fd commit 20f26b5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ EMCC?=emcc
22
EMXX?=em++
33
COFFEE?=coffee
44

5-
# you may have to add mingw path like this.
6-
#INCS?=-I/path/to/mingw/include
5+
# you may have to define mingw path like this.
6+
#MINGW?=/path/to/mingw
77

88
DEFS=-D_X86_ -DWIN32 -DUNICODE -DWIN32_LEAN_AND_MEAN
99
OBJS=src/library_win32.js src/window.js
1010
EXAMPLES=examples/hello.js
1111

12+
INCS=
13+
ifdef MINGW
14+
INCS=-I $(MINGW)/include
15+
endif
16+
1217
.PHONY: all
1318
all: $(OBJS)
1419

@@ -17,6 +22,7 @@ src/%.js: src/%.coffee
1722

1823
.PHONY: examples
1924
examples: $(EXAMPLES)
25+
mkdir -p examples/lib
2026
$(MAKE) -C lib/fake-mswin assets OUTDIR=../../examples/lib
2127

2228
examples/%.js: examples/%.cpp all

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ You need no Windows to run win32.js project.
1010
use a prebuilt package if available.
1111
- For Windows, You may use [clang-win32][] binary.
1212
3. Clone this repository. Note there is [fake-mswin][] submodule in use.
13-
4. `make examples`. It will build `examples/hello.cpp` to
14-
`examples/hello.js`.
13+
4. Execute `MINGW=/path/to/mingw make examples`.
14+
`examples/hello.cpp` is compiled into `examples/hello.js`.
1515
5. Open `examples/hello.html` using modern web browser.
1616

1717
[w32api]: http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/

0 commit comments

Comments
 (0)