Minor improvements.
[mediadatabase.git] / libdb / GNUmakefile
blob94aca5b642d4a088438b4b3c42097ed88d48c31a
1 ##############################################################################
3 # $Id: GNUmakefile,v 1.4 2004/05/21 23:38:40 nedko Exp $
5 # DESCRIPTION:
6 # Makefile for libdb
8 # AUTHOR:
9 # Nedko Arnaudov <nedko@users.sourceforge.net>
11 # LICENSE:
12 # GNU GENERAL PUBLIC LICENSE version 2
14 ##############################################################################
16 TOOL_PREFIX=@
18 CC = $(TOOL_PREFIX)gcc -c
19 CFLAGS = -g -Wall
20 LINKFLAGS :=
22 SOURCES = libdb.c memory.c mysql.c sqlite.c
24 OBJECTS = $(SOURCES:%.c=%.o)
26 # until we have dependencies it is better to rebuild each time
27 default: rebuild
29 build: libdb.a test
31 %.o:%.c
32 $(TOOL_PREFIX)echo "Compiling $< to $@ ..."
33 $(CC) $(CFLAGS) $< -o $@
36 libdb.a: $(OBJECTS)
37 $(TOOL_PREFIX)echo "Creating library $@"
38 $(TOOL_PREFIX)ar -rc $@ $(OBJECTS)
39 $(TOOL_PREFIX)ranlib $@
41 clean:
42 -$(TOOL_PREFIX)rm libdb.a 2>/dev/null ; echo -n
43 -$(TOOL_PREFIX)rm $(OBJECTS) 2>/dev/null ; echo -n
44 -$(TOOL_PREFIX)rm test.o 2>/dev/null ; echo -n
45 -$(TOOL_PREFIX)rm test 2>/dev/null ; echo -n
47 rebuild: clean libdb.a test
49 test: libdb.a test.o
50 $(TOOL_PREFIX)echo "Linking $@"
51 $(TOOL_PREFIX)gcc test.o libdb.a -lmysqlclient -lsqlite $(LINKFLAGS) -o $@
53 ##############################################################################
55 # Modifications log:
57 # !!! WARNING !!! Following lines are automatically updated by the CVS system.
59 # $Log: GNUmakefile,v $
60 # Revision 1.4 2004/05/21 23:38:40 nedko
61 # Minor improvements.
63 # Revision 1.3 2004/05/11 01:18:53 nedko
64 # Implement SQLite backend.
66 # Revision 1.2 2004/05/02 20:12:11 nedko
67 # Improve error dumps.
69 # Revision 1.1 2004/04/27 09:12:28 nedko
70 # Initial revision.
72 ##############################################################################