- added src/endian.h... still need to add configure support to
[barry.git] / src / Makefile
blob2c3da8cffacd58f7b425aa59a7526dca1e4c132d
2 # Makefile for the Barry library and test programs
5 include ../Makefile.conf
8 # Barry files
10 LIBOBJS = \
11 time.o \
12 base64.o \
13 parser.o \
14 data.o \
15 usbwrap.o \
16 probe.o \
17 common.o \
18 error.o \
19 socket.o \
20 protocol.o \
21 record.o \
22 controller.o
24 CONNECTOBJS = \
25 data.o \
26 usbwrap.o \
27 connect.o \
28 common.o \
31 BBTOOLOBJS = \
32 btool.o \
33 libbarry.a
35 UPLDIFOBJS = \
36 time.o \
37 base64.o \
38 parser.o \
39 data.o \
40 usbwrap.o \
41 probe.o \
42 common.o \
43 error.o \
44 socket.o \
45 protocol.o \
46 record.o \
47 controller.o \
48 upldif.o
52 # object files needed to build Barry
54 OBJS = $(LIBOBJS) $(CONNECTOBJS) $(BBTOOLOBJS) $(UPLDIFOBJS)
57 ###############################################################################
58 all: visual dep.mak tests connect btool upldif translate libbarry.a
60 visual:
61 echo ; echo
63 connect: $(CONNECTOBJS)
64 $(CXX) $(DEBUG) -o connect $(CONNECTOBJS) $(LDFLAGS)
66 btool: $(BBTOOLOBJS)
67 $(CXX) $(DEBUG) -o btool $(BBTOOLOBJS) $(LDFLAGS)
69 upldif: $(UPLDIFOBJS)
70 $(CXX) $(DEBUG) -o upldif $(UPLDIFOBJS) $(LDFLAGS)
72 translate: translate.cc
73 $(CXX) $(CXXFLAGS) -o translate translate.cc
75 libbarry.a: $(LIBOBJS)
76 ar rcs libbarry.a $(LIBOBJS)
78 #############
79 # Install
80 #############
82 install:
83 mkdir -p $(INSTALLDIR)
84 mkdir -p $(INSTALLDIR)/include/barry
85 mkdir -p $(INSTALLDIR)/lib
86 install libbarry.a $(INSTALLDIR)/lib
87 install barry.h base64.h builder.h common.h controller.h controllertmpl.h data.h debug.h error.h parser.h probe.h protocol.h protostructs.h record.h s11n-boost.h socket.h time.h usbwrap.h $(INSTALLDIR)/include/barry
90 #############
91 # Tests
92 #############
94 tests: test-data test-contact test-base64 test-time
96 test-time: time.h time.cc
97 $(CXX) $(CXXFLAGS) -D__TEST_MODE__ -o test-time time.cc
99 test-base64: base64.h base64.cc
100 $(CXX) $(CXXFLAGS) -D__TEST_MODE__ -o test-base64 base64.cc
102 test-data: data.h data.cc
103 $(CXX) $(CXXFLAGS) -D__TEST_MODE__ -o test-data data.cc
105 test-contact.o: record.cc
106 $(CXX) $(CXXFLAGS) -D__TEST_MODE__ -o test-contact.o -c record.cc
108 test-contact: test-contact.o data.o base64.o
109 $(CXX) $(CXXFLAGS) -o test-contact test-contact.o data.o base64.o
111 clean-tests:
112 rm -f test-data test-contact test-contact.o test-base64 test-time
114 #################
115 # Cleanup / Misc
116 #################
118 clean: clean-tests
119 rm -f $(OBJS) *.rpo */*.rpo dep.mak core core.* gmon.out leak.out
120 rm -f connect btool upldif
121 rm -f translate
122 rm -f libbarry.a
123 rm -rf ../doc/doxygen/html
124 rm -rf install
126 dep:
127 $(CXX) $(CXXFLAGS) -M *.cc > dep.mak
129 dep.mak:
130 make dep
131 make
133 # dependencies.... run make dep to create them
134 ifeq (dep.mak,$(wildcard dep.mak))
135 include dep.mak
136 endif