0a4fcb299c6ee17d1eedb780dd32ae86f897469d
[reactos.git] / reactos / lib / 3rdparty / libwin-iconv / Makefile
1 CC ?= gcc
2 AR ?= ar
3 RANLIB ?= ranlib
4 DLLTOOL ?= dlltool
5
6 # comma separated list (e.g. "iconv.dll,libiconv.dll")
7 DEFAULT_LIBICONV_DLL ?= \"\"
8
9 CFLAGS += -pedantic -Wall
10 CFLAGS += -DUSE_LIBICONV_DLL
11 CFLAGS += -DDEFAULT_LIBICONV_DLL=$(DEFAULT_LIBICONV_DLL)
12
13 all: iconv.dll libiconv.a win_iconv.exe
14
15 dist: test win_iconv.zip
16
17 iconv.dll: win_iconv.c
18 $(CC) $(CFLAGS) -c win_iconv.c -DMAKE_DLL
19 $(CC) -shared -o iconv.dll -Wl,-s -Wl,--out-implib=libiconv.dll.a -Wl,--export-all-symbols win_iconv.o $(SPECS_FLAGS)
20
21 libiconv.a: win_iconv.c
22 $(CC) $(CFLAGS) -c win_iconv.c
23 $(AR) rcs libiconv.a win_iconv.o
24 $(RANLIB) libiconv.a
25
26 win_iconv.exe: win_iconv.c
27 $(CC) $(CFLAGS) -s -o win_iconv.exe win_iconv.c -DMAKE_EXE
28
29 libmlang.a: mlang.def
30 $(DLLTOOL) --kill-at --input-def mlang.def --output-lib libmlang.a
31
32 test:
33 $(CC) $(CFLAGS) -s -o win_iconv_test.exe win_iconv_test.c
34 ./win_iconv_test.exe
35
36 win_iconv.zip: msvcrt msvcr70 msvcr71
37 rm -rf win_iconv
38 svn export . win_iconv
39 cp msvcrt/iconv.dll msvcrt/win_iconv.exe win_iconv/
40 mkdir win_iconv/msvcr70
41 cp msvcr70/iconv.dll win_iconv/msvcr70/
42 mkdir win_iconv/msvcr71
43 cp msvcr71/iconv.dll win_iconv/msvcr71/
44 zip -r win_iconv.zip win_iconv
45
46 msvcrt:
47 svn export . msvcrt; \
48 cd msvcrt; \
49 $(MAKE);
50
51 msvcr70:
52 svn export . msvcr70; \
53 cd msvcr70; \
54 gcc -dumpspecs | sed s/-lmsvcrt/-lmsvcr70/ > specs; \
55 $(MAKE) "SPECS_FLAGS=-specs=$$PWD/specs";
56
57 msvcr71:
58 svn export . msvcr71; \
59 cd msvcr71; \
60 gcc -dumpspecs | sed s/-lmsvcrt/-lmsvcr71/ > specs; \
61 $(MAKE) "SPECS_FLAGS=-specs=$$PWD/specs";
62
63 clean:
64 rm -f win_iconv.exe
65 rm -f win_iconv.o
66 rm -f iconv.dll*
67 rm -f libiconv.a
68 rm -f libiconv.dll
69 rm -f win_iconv_test.exe
70 rm -f libmlang.a
71 rm -rf win_iconv
72 rm -rf win_iconv.zip
73 rm -rf msvcrt
74 rm -rf msvcr70
75 rm -rf msvcr71
76