9a3c7649273039d168b123890e6bdcd0b28375b5
[swftools.git] / installer / Makefile
1 CC=/opt/xmingw/bin/i386-mingw32msvc-gcc -DWIN32
2 STRIP=/opt/xmingw/bin/i386-mingw32msvc-strip 
3 WINDRES=/opt/xmingw/bin/i386-mingw32msvc-windres
4
5 LICENSE=gpl.c
6
7 all: files1.exe files2.exe
8
9 LIBS=-lgdi32 -lshlwapi -lcomctl32 -lshell32 -lole32 -luuid
10
11 files1.c: ../win32/*.exe
12         CWD=`pwd`
13         cd ../win32;../installer/mkarchive `find`
14         mv ../win32/crnfiles.c ./files1.c
15
16 files2.c: ../win32_gui/*.exe ../win32_gui/*.swf
17         CWD=`pwd`
18         cd ../win32_gui;../installer/mkarchive `find`
19         mv ../win32_gui/crnfiles.c ./files2.c
20
21 %.o: %.c
22         $(CC) -c $<
23
24 crnfiles1.o: crnfiles1.c
25 crnfiles2.o: crnfiles2.c
26
27 depack.o: depack.c depack.h Makefile
28         $(CC) -c depack.c -o depack.o
29
30 archive.o: archive.c archive.c depack.h
31         $(CC) -c archive.c -o archive.o
32
33 license.o: $(LICENSE)
34         $(CC) -c $< -o license.o
35
36 installer.o: installer.c installer.h depack.h archive.h ../lib/os.h
37         $(CC) -c installer.c -o installer.o
38
39 installer.coff: installer.rc swftools.ico installer.h
40         $(WINDRES) installer.rc -O coff -F pe-i386 -o installer.coff
41
42 %.exe: %.c installer.o license.o depack.o archive.o depack.h installer.coff Makefile
43         $(CC) installer.o depack.o license.o archive.o installer.coff $< -o $@ $(LIBS)
44         $(STRIP) $@
45         ./makegui $@
46         #upx -9 --best $@ 2>/dev/null || true
47
48 #installer.exe: installer.c depack.o archive.o depack.h crnfiles.o installer.coff Makefile
49 #       $(CC) installer.c depack.o archive.o crnfiles.o installer.coff -o installer.exe $(LIBS)
50 #       $(STRIP) installer.exe
51 #       #./makegui installer.exe
52 #       #upx -9 --best installer.exe 2>/dev/null || true
53
54 clean:
55         rm -f installer.exe files*exe crnfiles.c *.o *.coff