-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.mingw
61 lines (45 loc) · 1.77 KB
/
Makefile.mingw
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
53
54
55
56
57
58
59
60
61
CC = g++
RC = windres
INCLUDE = -Iunrar -Iunzip -IC:\wxWidgets-2.6.2\include -IC:\wxWidgets-2.6.2\lib\gcc_lib\mswu
CFLAGS = -Os -Wall -pipe
CPPFLAGS = $(CFLAGS) -mthreads -DWIN32 -D__WXMSW__ -D_UNICODE -DwxUSE_UNICODE_MSLU=1 $(INCLUDE)
LDFLAGS = -mwindows -mthreads -Lunzip -Lunrar -Lc:\wxWidgets-2.6.2\lib\gcc_lib
LIBS = -lunrar -lminiunzip -lwxmsw26u_core -lwxbase26u -lwxjpeg -lwxpng -lz
WIN32_LIBS = -lunicows -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -loleacc
RESFLAGS = --use-temp-file --define __WXMSW__ --define _UNICODE --include-dir C:/wxWidgets-2.6.2/include --include-dir C:/wxWidgets-2.6.2/lib/gcc_lib/mswu
STRIP = strip
.SUFFIXES: .c .cpp .png .h .d .o .a .exe
DEPS = $(patsubst %.cpp,%.d,$(wildcard src/*.cpp))
OBJS = $(patsubst %.cpp,%.o,$(wildcard src/*.cpp)) src/Comical.o
ICONS = $(patsubst %.png,%.h,$(wildcard src/*.png))
all: Comical.exe
-include $(DEPS)
%.h : %.png bin2h.exe
bin2h.exe -c $< $*.h
%.o : %.c
$(CC) $(CFLAGS) -c -o $*.o $<
%.o : %.cpp
$(CC) $(CPPFLAGS) -c -o $*.o $<
%.o : %.rc
$(RC) $(RESFLAGS) -i$< -o$*.o
# make the ICONS a build dep for the .d files, because -MG doesn't include the
# path on dependencies it can't find
%.d : %.cpp $(ICONS)
$(CC) -MM $(CPPFLAGS) -MT '$*.o' -MF '$*.d' $<
Comical.exe: $(OBJS) unrar/libunrar.a unzip/libminiunzip.a
$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) $(WIN32_LIBS)
$(STRIP) $@
unrar/libunrar.a:
$(MAKE) lib -C unrar -f makefile.mingw
unzip/libminiunzip.a:
$(MAKE) -C unzip -f Makefile.mingw
bin2h.exe: src/bin2h.o
$(CC) -o $@ src/bin2h.o
clean:
-if exist src\*.o del src\*.o
-if exist comical.exe del comical.exe
distclean:
$(MAKE) clean
$(MAKE) clean -C unrar -f makefile.mingw
$(MAKE) clean -C unzip -f Makefile.mingw
.PHONY : clean distclean