Makefile 2.47 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.7 2004-01-28 15:56:08 tforb Exp $
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
# 
# Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach) 
# 
# C++ SFF code
# 
# 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
24
all: libsffxx.a doxybrief doxyfull
thomas.forbriger's avatar
thomas.forbriger committed
25

26
flist: Makefile README $(wildcard *.h *.cc *.cfg)
thomas.forbriger's avatar
thomas.forbriger committed
27
28
29
30
31
32
33
34
	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
35
	-/bin/rm -vf flist *.d *.o sffxx_tests
thomas.forbriger's avatar
thomas.forbriger committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

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

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

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

thomas.forbriger's avatar
thomas.forbriger committed
51
LIBSRC=sffxx.cc wid2compare.cc
thomas.forbriger's avatar
thomas.forbriger committed
52
INCSRC=sffxx.h
thomas.forbriger's avatar
thomas.forbriger committed
53
54
55

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

thomas.forbriger's avatar
thomas.forbriger committed
56
libsffxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
thomas.forbriger's avatar
thomas.forbriger committed
57
58
59
60
	ar rcv $@ $^
	ranlib $@
	newlib $@

thomas.forbriger's avatar
thomas.forbriger committed
61
install-include: ; newinclude sffxx.h
thomas.forbriger's avatar
thomas.forbriger committed
62
63
64
65

#======================================================================
# documentation part
# ------------------
thomas.forbriger's avatar
thomas.forbriger committed
66
DOXYWWWPATH=$(HOME)/public_html/txt/cxx/libsffxx
thomas.forbriger's avatar
thomas.forbriger committed
67
68
69
70
.PHONY: doxyclean doxyview doxybriefview doxyfullconf doxybriefconf

doxyclean: ;/bin/rm -rfv doc docbrief

71
DOXYSRC=README $(LIBSRC) $(INCSRC) sfftest.cc
thomas.forbriger's avatar
thomas.forbriger committed
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

doc/%: doxyfull.cfg $(DOXYSRC)
	mkdir -vp $(DOXYWWWPATH)
	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
88
doxybriefview: doxybrief; mozilla file:$(shell pwd)/docbrief/html/index.html &
thomas.forbriger's avatar
thomas.forbriger committed
89
90
91
92
93
94
doxyview: doxyfullview doxybrief

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

thomas.forbriger's avatar
thomas.forbriger committed
95
sfftest: sfftest.cc
thomas.forbriger's avatar
thomas.forbriger committed
96
	$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lsffxx -ltime++ -lgsexx -laff \
97
      -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
thomas.forbriger's avatar
thomas.forbriger committed
98
tests: sfftest; $<; rm -fv $<
thomas.forbriger's avatar
thomas.forbriger committed
99
100

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