VPATH = ../src:../src/ttsubset .RECIPEPREFIX += PKGCONFIG = C:\GTK\bin\pkg-config.exe #recipe above allows using spaces instead of the default tab in make files! print-% : ; @echo $* = $($*) RM = del /f /q CC = gcc CC_RES=windres #exclude empty.cpp src = $(wildcard ../src/*.c) $(wildcard ../src/ttsubset/*.c) #src = ../src/main.c res_src = $(wildcard ../inc/*.rc) objdir=$(DEV_BIN)/Release exefile=$(objdir)/xournal.exe _obj1 = $(patsubst %.c,%.o,$(src)) _res1 = $(patsubst %.rc,%.o,$(res_src)) obj = $(patsubst %.o,$(objdir)/%.o,$(notdir $(_obj1))) #obj = $(src:.c=.o) res_obj=$(patsubst %.o,$(objdir)/%.o,$(notdir $(_res1))) libs = -L$(MY_EXT)\lib_cairo\1.17.2\lib\x86 -lcairo \ $(shell $(PKGCONFIG) --libs gtk+-2.0) -lz \ $(shell $(PKGCONFIG) --libs libgnomecanvas-2.0) \ $(shell $(PKGCONFIG) --libs fontconfig) \ $(shell $(PKGCONFIG) --libs freetype2) \ -L$(MY_EXT)\do_not_sync\poppler-0.12.4\bin -l:libpoppler-glib.dll.a # $(shell $(PKGCONFIG) --libs poppler) \ # $(shell $(PKGCONFIG) --libs poppler-glib) # -LC:\program_files\xournal-0.4.8.2016-win32\libpoppler-84.dll \ #-LC:/GTK/lib/gtk-win32-2.0.lib \ # -LC:/GTK/lib/libgtk-win32-2.0.dll.a \ # -LC:/GTK/lib/glib-2.0.lib INCLUDES = -I../src -I../src/ttsubset \ -I$(MY_EXT)\lib_cairo\1.17.2\include\cairo \ $(shell $(PKGCONFIG) --cflags gtk+-2.0) \ $(shell $(PKGCONFIG) --cflags libgnomecanvas-2.0) \ $(shell $(PKGCONFIG) --cflags fontconfig) \ $(shell $(PKGCONFIG) --cflags freetype2) \ -I$(MY_EXT)\lib_poppler\0.12.4 #-IC:/GTK/include/gtk-2.0 \ #-IC:/GTK/include/glib-2.0 \ #-IC:/GTK/lib/glib-2.0/include \ #-IC:/GTK/include/pango-1.0 \ #-IC:/GTK/lib/gtk-2.0/include \ #-IC:/GTK/include/atk-1.0 \ #-I$(MY_EXT)\lib_gnomecanvas\2.13\include\libgnomecanvas-2.0 \ #-IC:/GTK/include/libart-2.0 \ #CXXFLAGS=-mwindows is for winodws GUI programming CXXFLAGS=-DNDEBUG \ -DWIN32 \ -DNO_MAPPERS \ -DNO_TYPE3 \ -DNO_TYPE42 \ -DVERSION=\""0.4.8.2016"\" \ -DPACKAGE_DATA_DIR=\""."\" \ -DPACKAGE=\"" "\" \ -O3 -g -s -flto -Wall -Wextra -mwindows -Wno-deprecated-declarations -Wno-unknown-pragmas #-m64 if 64-bit #link flags LDFLAGS = # rule to generate a dep file by using the C preprocessor # (see man cpp for details on the -MM and -MT options) # compiles .c to .o # $@ = $(output) # $< = $(input) $(objdir)/%.o: %.c @echo "Compiling..." $(CC) $(INCLUDES) $(CXXFLAGS) -c $< -o $@ $(res_obj): $(res_src) $(CC_RES) $< -o $@ xournal: $(res_obj) $(obj) @echo "Linking..." $(CC) $(CXXFLAGS) $(obj) $(res_obj) -o $(exefile) $(libs) $(LDFLAGS) #.PHONY: clean .. todo.. I don't think this is working! clean: $(RM) $(subst /,\,$(obj)) $(subst /,\,$(exefile))