Makefile 2.5 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.2 2003-12-22 09:08:55 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

thomas.forbriger's avatar
thomas.forbriger committed
26
flist: Makefile $(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
52
53
LIBSRC=sffxx.cc sffxx_TCHK2.cc sffxx_TWID2.cc sffxx_TSTA2.cc sffxx_TDAT2.cc \
       sffxx_cm6.cc
INCSRC=sffxx.h sffxx_diff.h sffxx_TDAT2.h
thomas.forbriger's avatar
thomas.forbriger committed
54
55
56

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

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

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

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

doxyclean: ;/bin/rm -rfv doc docbrief

thomas.forbriger's avatar
thomas.forbriger committed
72
DOXYSRC=$(LIBSRC) $(INCSRC) sfftest.cc
thomas.forbriger's avatar
thomas.forbriger committed
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

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 &
doxybriefview: doxybrief; mozilla file:/docbrief/html/index.html &
doxyview: doxyfullview doxybrief

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

thomas.forbriger's avatar
thomas.forbriger committed
96
97
98
sffxx_tests: sffxx_tests.cc
	$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lsffxx -L$(LOCLIBDIR)
tests: sffxx_tests; $<; rm -fv $<
thomas.forbriger's avatar
thomas.forbriger committed
99
100

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