Makefile 4.35 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.16 2006-03-28 18:26:59 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
#
# This library requires code from libgsexx, libaff, libtfxx and libtime.
thomas.forbriger's avatar
thomas.forbriger committed
26
27
28
# 
# REVISIONS and CHANGES 
#    18/12/2003   V1.0   Thomas Forbriger
thomas.forbriger's avatar
thomas.forbriger committed
29
#    28/03/2006   V1.1   provide a package
thomas.forbriger's avatar
thomas.forbriger committed
30
31
32
33
34
35
36
37
38
39
40
41
42
# 
# ============================================================================
#
# 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
43
44
all: install doxybrief doxyfull
install: install-include libsffxx.a
thomas.forbriger's avatar
thomas.forbriger committed
45

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

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

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

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

71
LIBSRC=sffxx.cc wid2compare.cc wid2inrange.cc wid2isample.cc \
72
73
  wid2lastsample.cc sffostream.cc srcesynref.cc
INCSRC=sffxx.h sffostream.h 
thomas.forbriger's avatar
thomas.forbriger committed
74
75
76

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

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

82
install-include: ; newinclude $(INCSRC)
thomas.forbriger's avatar
thomas.forbriger committed
83
84
85
86

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

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

92
DOXYSRC=README $(LIBSRC) $(INCSRC) sfftest.cc
thomas.forbriger's avatar
thomas.forbriger committed
93
94
95

doc/%: doxyfull.cfg $(DOXYSRC)
	mkdir -vp $(DOXYWWWPATH)
thomas.forbriger's avatar
thomas.forbriger committed
96
	/bin/rm -rfv doc/* doc
thomas.forbriger's avatar
thomas.forbriger committed
97
98
99
100
101
102
103
104
105
106
107
108
109
	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
110
doxybriefview: doxybrief; mozilla file:$(shell pwd)/docbrief/html/index.html &
thomas.forbriger's avatar
thomas.forbriger committed
111
112
113
114
115
116
doxyview: doxyfullview doxybrief

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

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

thomas.forbriger's avatar
thomas.forbriger committed
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#======================================================================
# create package
# --------------
VERSIONCODE=$(shell date +'%Y%m%d')
PACKAGE=libsffxx$(VERSIONCODE)
PUBLICATIONPATH=$(HOME)/public_html/download/software
TMPPATH=$(HOME)/tmp/$(PACKAGE)
package:
	/bin/rm -rfv $(TMPPATH); mkdir -pv $(TMPPATH)
	cd $(TMPPATH)/..; cvs export -r HEAD -d $(PACKAGE) thof/src/libs/libsffxx
	cd $(TMPPATH)/..; cvs export -r HEAD -d $(PACKAGE) thof/src/LICENSE.GPL
	cd $(TMPPATH)/..; cvs export -r HEAD \
        -d $(PACKAGE) thof/src/README.compile
	/bin/bash -c 'cd $(TMPPATH); \
        export WWWBASEDIR=doxydoc; \
        make all; make clean'
	cd $(TMPPATH)/..; tar cvf $(PUBLICATIONPATH)/$(PACKAGE).tar $(PACKAGE)
	gzip --force -9 $(PUBLICATIONPATH)/$(PACKAGE).tar
	cd $(TMPPATH)/..; tar cvf $(PUBLICATIONPATH)/$(PACKAGE).tar $(PACKAGE)
	bzip2 -f $(PUBLICATIONPATH)/$(PACKAGE).tar

thomas.forbriger's avatar
thomas.forbriger committed
144
# ----- END OF Makefile -----