-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile.win
43 lines (33 loc) · 1.34 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
PREFIX?=C:/bsdconv
BSDCONV_PATH?=${PREFIX}
CFLAGS+=-Wall -O2 -DPREFIX='"${PREFIX}"' -DBSDCONV_PATH='"${BSDCONV_PATH}"' -DWIN32 -D_BSDCONV_INTERNAL
CC?=mingw32-cc
all: builddir libbsdconv bsdconv_mktable bsdconv modules meta
builddir:
mkdir -p build/
mkdir -p build/include
mkdir -p build/modules
mkdir -p build/modules/filter
mkdir -p build/modules/from
mkdir -p build/modules/inter
mkdir -p build/modules/scorer
mkdir -p build/modules/src
mkdir -p build/modules/to
libbsdconv: builddir
$(CC) ${CFLAGS} src/missing_func.c src/libbsdconv.c -shared -o build/libbsdconv.dll
bsdconv: builddir libbsdconv src/bsdconv.c
$(CC) ${CFLAGS} -lbsdconv -L./build/ src/bsdconv.c -o build/bsdconv.exe
bsdconv_mktable: builddir src/bsdconv-mktable.c
$(CC) ${CFLAGS} src/missing_func.c src/bsdconv-mktable.c -o build/bsdconv_mktable.exe
codecs_table: builddir bsdconv_mktable
cd modules && \
find */*.txt -type f | awk -F. '{cmd="bsdconv_mktable ../modules/"$$1"."$$2" modules/"$$1; print(cmd);}' > ../build/mk_table.bat
codecs_callback: builddir libbsdconv
cd modules && \
find */*.c -type f | awk -F. '{cmd="$(CC) ${CFLAGS} -shared -lbsdconv -L../build/ -o ../build/modules/"$$1".dll "$$1"."$$2" -lwsock32"; system(cmd);}'
modules: builddir codecs_table codecs_callback
meta:
cp src/bsdconv.h build/include/
cp tools/setEnvVar.bat build/
clean:
rm -rf build