- added dbsetup data script, which shows how to get into database
[barry.git] / src / Makefile
blob2d65ef72c000af69a1fec48fc5ac1263fcfa93b6
2 # Makefile for the Syncberry library and test programs
6 # debug flags (note: __DEBUG_MODE__ also turns assert's NDEBUG off and on
7 # appropriately)
9 #DEBUG = -g -pg -D__DEBUG_MODE__
10 #DEBUG = -g -D__DEBUG_MODE__
11 DEBUG = -g
12 #DEBUG = -D__DEBUG_MODE__
13 #DEBUG =
14 #LDDEBUG = -u malloc -lefence
15 #LDDEBUG = -u malloc -u free -ldmalloc
16 LDDEBUG =
19 # include directories to various libraries we use
21 LIBUSBINC = ../../external/rootdir/libusb/include
22 INCLUDE = -I$(LIBUSBINC)
25 # optimization flags
26 # http://gcc.gnu.org/ml/gcc/2000-04/msg00377.html
27 # http://gcc.gnu.org/ml/gcc-help/2004-12/msg00142.html
28 # http://gcc.gnu.org/ml/gcc-help/2004-12/msg00147.html
29 # (current winner is at the top)
31 #OPTFLAGS = -frepo -fdata-sections -ffunction-sections
32 #OPTFLAGS = -frepo -fdata-sections
33 OPTFLAGS =
34 #OPTFLAGS = -frepo
35 #OPTFLAGS = -fno-enforce-eh-specs -fno-default-inline -fno-implement-inlines
36 #OPTFLAGS = -fno-inline
37 #OPTFLAGS = -fno-implicit-templates
38 #OPTFLAGS = -Os
39 #OPTFLAGS = -Os -fomit-frame-pointer
40 #OPTFLAGS = -Os -fomit-frame-pointer -mcpu=i386
43 # warning and error checking flags
45 #WARNFLAGS =
46 WARNFLAGS = -ansi -Wall
47 #WARNFLAGS = -ansi -pedantic -Wall -W -Wold-style-cast -Wfloat-equal -Wwrite-strings -Wno-long-long
48 #WARNFLAGS = -ansi -pedantic -Wall -W -Weffc++ -Woverloaded-virtual -Wold-style-cast -Wfloat-equal -Wwrite-strings -Wno-long-long -Werror
51 # compiler flags
53 CXX = g++
54 CXXFLAGS = $(WARNFLAGS) $(OPTFLAGS) $(INCLUDE) $(SPECIAL) $(DEBUG)
55 #LDFLAGS = -s -lmysqlpp -lfaxutil -lldap $(LDDEBUG)
56 LDFLAGS = ../../external/rootdir/libusb/lib/libusb.a -lpthread $(LDDEBUG)
57 #LDFLAGS = -Wl,--gc-sections -s -lmysqlpp -lfaxutil -lldap $(LDDEBUG)
60 # Syncberry files
62 CONNECTOBJS = \
63 data.o \
64 usbwrap.o \
65 connect.o \
68 BBTOOLOBJS = \
69 data.o \
70 usbwrap.o \
71 bbtool.o \
72 probe.o \
73 sbcommon.o \
74 error.o \
75 socket.o \
76 protocol.o \
77 blackberry.o \
81 # object files needed to build syncberry
83 OBJS = $(CONNECTOBJS) $(BBTOOLOBJS)
86 ###############################################################################
87 all: visual dep.mak tests connect bbtool translate
89 visual:
90 echo ; echo
92 connect: $(CONNECTOBJS)
93 $(CXX) $(DEBUG) -o connect $(CONNECTOBJS) $(LDFLAGS)
95 bbtool: $(BBTOOLOBJS)
96 $(CXX) $(DEBUG) -o bbtool $(BBTOOLOBJS) $(LDFLAGS)
98 translate: translate.cc
99 $(CXX) $(CXXFLAGS) $(DEBUG) -O2 -pg -o translate translate.cc
101 #############
102 # Tests
103 #############
105 tests: data-test
107 data-test: data.h data.cc
108 $(CXX) $(CXXFLAGS) -D__TEST_MODE__ $(DEBUG) -O2 -g -o data-test data.cc
110 clean-tests:
111 rm -f data-test
113 #################
114 # Cleanup / Misc
115 #################
117 clean: clean-tests
118 rm -f $(OBJS) *.rpo */*.rpo dep.mak core core.* gmon.out leak.out
119 rm -f connect bbtool
120 rm -f translate
122 dep:
123 $(CXX) $(CXXFLAGS) -M *.cc > dep.mak
125 dep.mak:
126 @echo "Please run 'make dep'"
127 @echo
128 @exit 1
130 # dependencies.... run make dep to create them
131 ifeq (dep.mak,$(wildcard dep.mak))
132 include dep.mak
133 endif