Makefile 3.37 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
3
# $Id: Makefile,v 1.15 2006-03-28 15:58:17 tforb Exp $
thomas.forbriger's avatar
thomas.forbriger committed
4
5
6
7
# 
# Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach) 
# 
# C++ SFF code
thomas.forbriger's avatar
thomas.forbriger committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
# ----
# 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
# ----
thomas.forbriger's avatar
thomas.forbriger committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 
# REVISIONS and CHANGES 
#    18/12/2003   V1.0   Thomas Forbriger
# 
# ============================================================================
#
# general part
# ------------
#

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

thomas.forbriger's avatar
thomas.forbriger committed
40
41
all: install doxybrief doxyfull
install: install-include libsffxx.a
thomas.forbriger's avatar
thomas.forbriger committed
42

43
flist: Makefile README $(wildcard *.h *.cc *.cfg)
thomas.forbriger's avatar
thomas.forbriger committed
44
45
46
47
48
49
50
51
	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
52
	-/bin/rm -vf flist *.d *.o sffxx_tests
thomas.forbriger's avatar
thomas.forbriger committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

#======================================================================
# pattern rules
# -------------

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

#======================================================================
# library part
# ------------

68
LIBSRC=sffxx.cc wid2compare.cc wid2inrange.cc wid2isample.cc \
69
70
  wid2lastsample.cc sffostream.cc srcesynref.cc
INCSRC=sffxx.h sffostream.h 
thomas.forbriger's avatar
thomas.forbriger committed
71
72
73

-include $(patsubst %.cc,%.d,$(LIBSRC))

thomas.forbriger's avatar
thomas.forbriger committed
74
libsffxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
thomas.forbriger's avatar
thomas.forbriger committed
75
76
77
78
	ar rcv $@ $^
	ranlib $@
	newlib $@

79
install-include: ; newinclude $(INCSRC)
thomas.forbriger's avatar
thomas.forbriger committed
80
81
82
83

#======================================================================
# documentation part
# ------------------
thomas.forbriger's avatar
thomas.forbriger committed
84
DOXYWWWPATH=$(HOME)/public_html/txt/cxx/libsffxx
thomas.forbriger's avatar
thomas.forbriger committed
85
86
.PHONY: doxyclean doxyview doxybriefview doxyfullconf doxybriefconf

thomas.forbriger's avatar
thomas.forbriger committed
87
doxyclean: ;/bin/rm -rfv doc/* docbrief/* doc docbrief
thomas.forbriger's avatar
thomas.forbriger committed
88

89
DOXYSRC=README $(LIBSRC) $(INCSRC) sfftest.cc
thomas.forbriger's avatar
thomas.forbriger committed
90
91
92

doc/%: doxyfull.cfg $(DOXYSRC)
	mkdir -vp $(DOXYWWWPATH)
thomas.forbriger's avatar
thomas.forbriger committed
93
	/bin/rm -rfv doc/* doc
thomas.forbriger's avatar
thomas.forbriger committed
94
95
96
97
98
99
100
101
102
103
104
105
106
	ln -sfv $(DOXYWWWPATH) doc
	doxygen $<

docbrief/%: doxybrief.cfg $(DOXYSRC); doxygen $<

doxybriefconf doxyfullconf: doxy%conf: 
	doxywizard $(patsubst doxy%conf,doxy%.cfg,$@)

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

doxyfullview: doxyfull; mozilla file:$(DOXYWWWPATH)/html/index.html &
thomas.forbriger's avatar
thomas.forbriger committed
107
doxybriefview: doxybrief; mozilla file:$(shell pwd)/docbrief/html/index.html &
thomas.forbriger's avatar
thomas.forbriger committed
108
109
110
111
112
113
doxyview: doxyfullview doxybrief

#======================================================================
# test code
# ---------

114
sfftest: sfftest.cc all
thomas.forbriger's avatar
thomas.forbriger committed
115
	$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lsffxx -ltime++ -lgsexx -laff \
116
        -ltfxx \
117
      -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
thomas.forbriger's avatar
thomas.forbriger committed
118
tests: sfftest; $<; rm -fv $<
thomas.forbriger's avatar
thomas.forbriger committed
119
120

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