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