Makefile 3.12 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
3
# $Id$
thomas.forbriger's avatar
thomas.forbriger committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 
# Copyright (c) 2008 by Thomas Forbriger (BFO Schiltach) 
# 
# some code to control the Thies datalogger DL1/N
#
# ----
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. 
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
# ----
#
# 
# REVISIONS and CHANGES 
#    24/11/2008   V1.0   Thomas Forbriger
# 
# ============================================================================
#

thomas.forbriger's avatar
thomas.forbriger committed
32
33
HEADERS=$(wildcard *.h)

thomas.forbriger's avatar
thomas.forbriger committed
34
SUBSRC=error.cc dataline.cc record.cc thiesdl1.cc functions.cc memory.cc \
thomas.forbriger's avatar
thomas.forbriger committed
35
  logger.cc cvsids.cc
36
SUBOBS=$(patsubst %.cc,%.o,$(SUBSRC))
thomas.forbriger's avatar
thomas.forbriger committed
37

38
all: DL1logger DL1direct
thomas.forbriger's avatar
thomas.forbriger committed
39

thomas.forbriger's avatar
thomas.forbriger committed
40
flist: Makefile $(wildcard *.cc *.h *.cfg *.sh) README
thomas.forbriger's avatar
thomas.forbriger committed
41
42
43
44
45
46
47
48
	echo $^ | tr ' ' '\n' | sort > $@

.PHONY: edit
edit: flist; vim $<

.PHONY: clean
clean: ; 
	-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
thomas.forbriger's avatar
thomas.forbriger committed
49
	-/bin/rm -vf flist *.o *.xxx
thomas.forbriger's avatar
thomas.forbriger committed
50
51
52
53
54
55
56

FLAGS=
CXXFLAGS=-fhonor-std -Wall $(FLAGS)
CXXFLAGS=-Wall $(FLAGS)
LDFLAGS=-L$(LOCLIBDIR)
CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)

thomas.forbriger's avatar
thomas.forbriger committed
57
58
59
60
61
62
63
64
#----------------------------------------------------------------------

cvsids.xxx: $(wildcard *.cc *.h)
	ident $^ | egrep '^ *\$$Id:' | sort | uniq | \
        awk 'BEGIN{ print "const char* const CVSIDS[]={"; } \
          { print "\"" $$0 "\","; } \
          END{ print "0};"; }' \
      > $@
thomas.forbriger's avatar
thomas.forbriger committed
65
cvsids.cc: cvsids.xxx
thomas.forbriger's avatar
thomas.forbriger committed
66
     
thomas.forbriger's avatar
thomas.forbriger committed
67
68
69
70
71
72
73
74
75
76
#======================================================================
# pattern rules
# -------------

%.d: %.cc
	$(SHELL) -ec '$(CXX) -M $(CPPFLAGS) $< \
      | sed '\''s,\($(notdir $*)\)\.o[ :]*,$(dir $@)\1.o $@ : ,g'\'' \
        > $@; \
      [ -s $@ ] || rm -f $@'

thomas.forbriger's avatar
thomas.forbriger committed
77
78
-include $(patsubst %.cc,%.d,$(wildcard *.cc))

thomas.forbriger's avatar
thomas.forbriger committed
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#======================================================================
# documentation part
# ------------------
DOXYWWWPATH=$(WWWBASEDIR)/ThiesDL1
.PHONY: doxyclean doxyview doxybriefview doxyfullconf doxybriefconf

doxyclean: ;/bin/rm -rfv doc/* docbrief/* doc docbrief

DOXYSRC=$(wildcard *.cc) $(HEADERS) 

doc/%: doxygen.cfg $(DOXYSRC)
	mkdir -vp $(DOXYWWWPATH)
	/bin/rm -rfv doc/* doc
	ln -sfv $(DOXYWWWPATH) doc
	doxygen $<

doxyfull: doc/html/index.html
doxydoc: doxyfull

doxyfullview: doxyfull; $(TF_BROWSER) file:$(DOXYWWWPATH)/html/index.html &
doxyview: doxyfullview 

#======================================================================

thomas.forbriger's avatar
thomas.forbriger committed
103
tester DL1direct DL1logger: %: %.o $(SUBOBS)
104
	$(CXX) $(FLAGS) -o $@ $^ -I$(LOCINCLUDEDIR) \
thomas.forbriger's avatar
thomas.forbriger committed
105
        -ltsxx -lsffxx -lgsexx -lserialxx -ltime++ -ltfxx -laff \
thomas.forbriger's avatar
thomas.forbriger committed
106
107
108
109
        -L$(LOCLIBDIR)
	/bin/mv -fv $@ $(LOCBINDIR)

# ----- END OF Makefile -----