# HG changeset patch # User meillo@marmaro.de # Date 1206039698 -3600 # Node ID 7e1cf00de1df470eb3b80c450cc698ae459ac5c7 # Parent b0824876d379976f5d3d24aef01b0e0502b02b4b completely refactored makefile; removed interface.h diff -r b0824876d379 -r 7e1cf00de1df Makefile --- a/Makefile Thu Mar 20 19:31:44 2008 +0100 +++ b/Makefile Thu Mar 20 20:01:38 2008 +0100 @@ -1,26 +1,34 @@ -# basic GTK+ app makefile -SOURCES = interface.c callbacks.c support.c main.c interface.h callbacks.h support.h -OBJS = ${SOURCES:.c=.o} -#CFLAGS = `gtk-config --cflags` -#LDADD = `gtk-config --libs --cflags` -datadir = /usr/local/share -CFLAGS = `pkg-config --cflags gtk+-2.0` -LDADD = `pkg-config --libs --cflags gtk+-2.0` -CC = gcc -PACKAGE = cropper +# makefile for cropper +NAME = cropper +SRC = interface.c callbacks.c support.c main.c +DEP = main.h callbacks.h support.h +OBJ = ${SRC:.c=.o} -all : ${OBJS} - ${CC} -o ${PACKAGE} ${OBJS} ${LDADD} +CC = gcc +CFLAGS = `pkg-config --cflags gtk+-2.0` +LDFLAGS = `pkg-config --libs --cflags gtk+-2.0` + + + +all: ${NAME} + +${NAME}: ${OBJ} ${DEP} + ${CC} -o ${NAME} ${OBJ} ${LDFLAGS} .c.o: ${CC} ${CFLAGS} -c $< +support.o: support.h +interface.o: main.h callbacks.h support.h +callbacks.o: main.h callbacks.h support.h +main.o: main.h support.h + + clean: rm -f *.o - rm -f ${PACKAGE} - -# end of file +realclean: clean + rm -f ${NAME} diff -r b0824876d379 -r 7e1cf00de1df callbacks.c --- a/callbacks.c Thu Mar 20 19:31:44 2008 +0100 +++ b/callbacks.c Thu Mar 20 20:01:38 2008 +0100 @@ -3,7 +3,6 @@ #include "main.h" #include "callbacks.h" -#include "interface.h" #include "support.h" int image_width; @@ -225,12 +224,12 @@ gtk_main_quit(); } -void on_cropper_window_create (GtkObject* object, gpointer user_data) { +void on_cropper_window_create(GtkObject* object, gpointer user_data) { image_width = gdk_pixbuf_get_width(image_buffer); image_height = gdk_pixbuf_get_height(image_buffer); } -void on_cropper_window_destroy (GtkObject* object, gpointer user_data) { +void on_cropper_window_destroy(GtkObject* object, gpointer user_data) { gtk_main_quit(); } diff -r b0824876d379 -r 7e1cf00de1df interface.c --- a/interface.c Thu Mar 20 19:31:44 2008 +0100 +++ b/interface.c Thu Mar 20 20:01:38 2008 +0100 @@ -10,7 +10,6 @@ #include "main.h" #include "callbacks.h" -#include "interface.h" #include "support.h" #define GLADE_HOOKUP_OBJECT(component,widget,name) \ diff -r b0824876d379 -r 7e1cf00de1df interface.h --- a/interface.h Thu Mar 20 19:31:44 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -#include - -GtkWidget* create_cropper_window(void); - - -GdkPixbuf *image_buffer; diff -r b0824876d379 -r 7e1cf00de1df main.c --- a/main.c Thu Mar 20 19:31:44 2008 +0100 +++ b/main.c Thu Mar 20 20:01:38 2008 +0100 @@ -1,7 +1,6 @@ #include #include "main.h" -#include "interface.h" #include "support.h" diff -r b0824876d379 -r 7e1cf00de1df main.h --- a/main.h Thu Mar 20 19:31:44 2008 +0100 +++ b/main.h Thu Mar 20 20:01:38 2008 +0100 @@ -6,4 +6,8 @@ GtkWidget* cropper_window; char* image_filename; +/* from interface.h */ +GtkWidget* create_cropper_window(void); +GdkPixbuf *image_buffer; + #endif