Revision: 94
http://extractor-gtk.svn.sourceforge.net/extractor-gtk/?rev=94&view=rev
Author: someone-guy
Date: 2008-08-22 16:07:38 +0000 (Fri, 22 Aug 2008)
Log Message:
-----------
Nicer Makefile
Modified Paths:
--------------
trunk/extractor/Makefile
Modified: trunk/extractor/Makefile
===================================================================
--- trunk/extractor/Makefile 2008-08-22 16:07:14 UTC (rev 93)
+++ trunk/extractor/Makefile 2008-08-22 16:07:38 UTC (rev 94)
@@ -1,10 +1,6 @@
CC=gcc
CFLAGS=-Wall -Wdeclaration-after-statement -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -g -O2
CFLAGS+=-std=c99 -D_XOPEN_SOURCE=500
-GTKFLAGS=`pkg-config --cflags --libs gtk+-2.0`
-#GTKFLAGS=-DWITHOUT_GTK
-#GTKFLAGS=-mms-bitfields -Iinclude libglib-2.0-0.dll libgobject-2.0-0.dll libgdk-win32-2.0-0.dll libgdk_pixbuf-2.0-0.dll libgtk-win32-2.0-0.dll intl.dll
-#GTKFLAGS+=-mwindows
MODULES= \
bloodrayne.c \
generic.c \
@@ -18,16 +14,38 @@
MAIN= \
extractor.c \
helpers.c \
- gtkstuff.c \
-HEADERS= \
- helpers.h \
- formats.h \
+ifeq ($(WITHOUT_GTK), yes)
+GTKFLAGS=-DWITHOUT_GTK
+else
+MAIN+= gtkstuff.c
+GTKFLAGS=`pkg-config --cflags --libs gtk+-2.0`
+#GTKFLAGS=-mms-bitfields -Iinclude libglib-2.0-0.dll libgobject-2.0-0.dll libgdk-win32-2.0-0.dll libgdk_pixbuf-2.0-0.dll libgtk-win32-2.0-0.dll intl.dll
+#GTKFLAGS+=-mwindows
+endif
+SRCS=$(MAIN) $(MODULES)
+OBJS=${SRCS:.c=.o}
+DEPS=${SRCS:.c=.d}
+
all: extractor
-extractor: $(MAIN) $(MODULES)
+depend: $(DEPS)
+
+%.d: %.c
+ $(CC) -MM $(CFLAGS) $(GTKFLAGS) $< -o $@
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) $(GTKFLAGS) $< -o $@
+
+extractor: $(OBJS)
$(CC) $(CFLAGS) $(GTKFLAGS) $^ -o $@
clean:
- rm -f extractor *.o
+ rm -f extractor *.o *.d
+
+.PHONY: all clean depend
+
+ifneq ($(MAKECMDGOALS), clean)
+-include $(DEPS)
+endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|