--- Makefile.orig 2011-05-17 19:30:28.000000000 -0300 +++ Makefile 2011-05-17 20:31:12.000000000 -0300 @@ -1,9 +1,10 @@ +CC ?= gcc +PKG_CONFIG ?= pkg-config -CC=gcc -LD=gcc +CFLAGS ?= -Wall -g -O3 -ansi -pedantic -CFLAGS = -Wall -c -g -O3 -ansi -pedantic `pkg-config --cflags gtk+-2.0` -LDFLAGS = `pkg-config --libs gtk+-2.0` -lz -lpng -ljpeg +MY_CFLAGS = $(CFLAGS) $(shell $(PKG_CONFIG) --cflags gtk+-2.0) +MY_LDFLAGS = $(LDFLAGS) $(shell $(PKG_CONFIG) --libs gtk+-2.0) $(shell $(PKG_CONFIG) --libs libpng) -ljpeg -lm CFILES = main.c memory.c png.c editor.c common.c palette.c tiled.c jpg.c bmp.c string.c pcx.c prefs.c exit.c tga.c HFILES = main.h memory.h png.h editor.h common.h palette.h tiled.h jpg.h bmp.h string.h pcx.h prefs.h exit.h tga.h @@ -12,50 +13,50 @@ all: $(OFILES) Makefile - $(LD) $(LDFLAGS) $(OFILES) -o $(EXECUT) -lm ; strip $(EXECUT) + $(CC) $(OFILES) -o $(EXECUT) $(MY_LDFLAGS) main.o: main.c defines.h - $(CC) $(CFLAGS) main.c + $(CC) -c $(MY_CFLAGS) main.c memory.o: memory.c defines.h - $(CC) $(CFLAGS) memory.c + $(CC) -c $(MY_CFLAGS) memory.c png.o: png.c defines.h - $(CC) $(CFLAGS) png.c + $(CC) -c $(MY_CFLAGS) png.c editor.o: editor.c defines.h - $(CC) $(CFLAGS) editor.c + $(CC) -c $(MY_CFLAGS) editor.c common.o: common.c defines.h - $(CC) $(CFLAGS) common.c + $(CC) -c $(MY_CFLAGS) common.c palette.o: palette.c defines.h - $(CC) $(CFLAGS) palette.c + $(CC) -c $(MY_CFLAGS) palette.c tiled.o: tiled.c defines.h - $(CC) $(CFLAGS) tiled.c + $(CC) -c $(MY_CFLAGS) tiled.c jpg.o: jpg.c defines.h - $(CC) $(CFLAGS) jpg.c + $(CC) -c $(MY_CFLAGS) jpg.c bmp.o: bmp.c defines.h - $(CC) $(CFLAGS) bmp.c + $(CC) -c $(MY_CFLAGS) bmp.c string.o: string.c defines.h - $(CC) $(CFLAGS) string.c + $(CC) -c $(MY_CFLAGS) string.c pcx.o: pcx.c defines.h - $(CC) $(CFLAGS) pcx.c + $(CC) -c $(MY_CFLAGS) pcx.c prefs.o: prefs.c defines.h - $(CC) $(CFLAGS) prefs.c + $(CC) -c $(MY_CFLAGS) prefs.c exit.o: exit.c defines.h - $(CC) $(CFLAGS) exit.c + $(CC) -c $(MY_CFLAGS) exit.c tga.o: tga.c defines.h - $(CC) $(CFLAGS) tga.c + $(CC) -c $(MY_CFLAGS) tga.c $(OFILES): $(HFILES)