2 # Makefile for the Syncberry library and test programs
6 # debug flags (note: __DEBUG_MODE__ also turns assert's NDEBUG off and on
9 #DEBUG = -g -pg -D__DEBUG_MODE__
10 #DEBUG = -g -D__DEBUG_MODE__
12 #DEBUG = -D__DEBUG_MODE__
14 #LDDEBUG = -u malloc -lefence
15 #LDDEBUG = -u malloc -u free -ldmalloc
19 # include directories to various libraries we use
21 LIBUSBINC
= ..
/..
/external
/rootdir
/libusb
/include
22 INCLUDE
= -I
$(LIBUSBINC
)
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
35 #OPTFLAGS = -fno-enforce-eh-specs -fno-default-inline -fno-implement-inlines
36 #OPTFLAGS = -fno-inline
37 #OPTFLAGS = -fno-implicit-templates
39 #OPTFLAGS = -Os -fomit-frame-pointer
40 #OPTFLAGS = -Os -fomit-frame-pointer -mcpu=i386
43 # warning and error checking flags
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
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)
81 # object files needed to build syncberry
83 OBJS
= $(CONNECTOBJS
) $(BBTOOLOBJS
)
86 ###############################################################################
87 all: visual dep.mak tests connect bbtool translate
92 connect
: $(CONNECTOBJS
)
93 $(CXX
) $(DEBUG
) -o connect
$(CONNECTOBJS
) $(LDFLAGS
)
96 $(CXX
) $(DEBUG
) -o bbtool
$(BBTOOLOBJS
) $(LDFLAGS
)
98 translate
: translate.
cc
99 $(CXX
) $(CXXFLAGS
) $(DEBUG
) -O2
-pg
-o translate translate.
cc
107 data-test
: data.h data.
cc
108 $(CXX
) $(CXXFLAGS
) -D__TEST_MODE__
$(DEBUG
) -O2
-g
-o data-test data.
cc
118 rm -f
$(OBJS
) *.rpo
*/*.rpo dep.mak core core.
* gmon.out leak.out
123 $(CXX
) $(CXXFLAGS
) -M
*.
cc > dep.mak
126 @echo
"Please run 'make dep'"
130 # dependencies.... run make dep to create them
131 ifeq (dep.mak
,$(wildcard dep.mak
))