Check for GTK+ version
[mediadatabase.git] / gtk / GNUmakefile
blobc31a34bdd1e2a10b4d1438403c850298ed8b4ae7
1 ##############################################################################
3 # $Id: GNUmakefile,v 1.6 2004/11/21 14:02:54 nedko Exp $
5 # DESCRIPTION:
6 # Makefile for console mediadatabase frontends
8 # AUTHOR:
9 # Nedko Arnaudov <nedko@users.sourceforge.net>
11 # LICENSE:
12 # GNU GENERAL PUBLIC LICENSE version 2
14 ##############################################################################
16 PATHTOTOP=../
18 include $(PATHTOTOP)common.mk
20 GTK_ATLEAST_VERSION=2.4
21 GTK_OK := $(shell if pkg-config --atleast-version=$(GTK_ATLEAST_VERSION) gtk+-2.0 ;then echo yes ; else echo no ; fi)
23 ifeq ($GTK_OK,yes)
24 CFLAGS += -g -Wall $(shell pkg-config --cflags gtk+-2.0)
25 LINKFLAGS += -g $(shell pkg-config --libs gtk+-2.0)
27 SOURCES = main.c medias.c media.c helper.c menu.c search.c
29 OBJECTS = $(SOURCES:%.c=%.o)
30 DEP_FILES = $(OBJECTS:.o=.d)
32 default: build
34 build: mdb_gtk
36 %.o:%.c
37 $(ECHO) "Compiling $< to $@ ..."
38 $(CC) $(CFLAGS) $< -o $@
40 %.d:%.c
41 @echo "Creating dependency file $@ for $<"
42 $(GENDEP_C)
44 full_clean: clean
45 $(ECHO) "Removing dependency files ..."
46 $(RM_BEGIN) $(DEP_FILES) $(RM_END)
48 clean:
49 $(ECHO) "Cleaning ..."
50 $(RM_BEGIN) mdb_gtk $(RM_END)
51 $(RM_BEGIN) $(OBJECTS) $(RM_END)
53 rebuild: clean build
55 mdb_gtk: $(OBJECTS) ../libfrontend/libfrontend.a ../libdb/libdb.a
56 $(ECHO) "Linking $@"
57 $(LINK) $(LINKFLAGS) $(OBJECTS) ../libfrontend/libfrontend.a ../libdb/libdb.a -lmysqlclient -lcfl -lsqlite -o $@
59 # All object and dependency files depend on this file
60 $(OBJECTS) $(DEP_FILES): GNUmakefile
62 ifeq (,$(findstring clean,$(TARGET)))
63 -include $(DEP_FILES)
64 endif
66 else # GTK_OK
67 default:
68 @echo "Not building GTK frontend because cannot find good version of GTK+ (at least $(GTK_ATLEAST_VERSION))"
69 endif # GTK_OK
71 ##############################################################################
73 # Modifications log:
75 # !!! WARNING !!! Following lines are automatically updated by the CVS system.
77 # $Log: GNUmakefile,v $
78 # Revision 1.6 2004/11/21 14:02:54 nedko
79 # Check for GTK+ version
81 # Revision 1.5 2004/09/01 05:01:23 nedko
82 # Use common c/c++ flags
83 # Depend on internat libraries.
85 # Revision 1.4 2004/08/31 22:40:15 nedko
86 # Partitally implemented search feature.
88 # Revision 1.3 2004/06/20 12:24:21 nedko
89 # Use dependency files.
90 # Use common tool variables.
92 # Revision 1.2 2004/05/21 23:43:38 nedko
93 # Implement media window.
95 # Revision 1.1 2004/05/16 19:05:38 nedko
96 # Initial revision of the gtk frontend.
98 # Revision 1.3 2004/05/11 01:33:48 nedko
99 # Add SQLite support.
101 # Revision 1.2 2004/05/03 20:48:48 nedko
102 # configuration file and update mode for cui
104 # Revision 1.1 2004/05/02 13:24:36 nedko
105 # Use makefile to build cui frontend(s).
107 ##############################################################################