Makefile 2.59 KB
Newer Older
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
3
# $Id: Makefile,v 1.5 2003-06-24 07:45:54 tforb Exp $
4
5
6
7
8
9
10
# 
# Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt) 
# 
# GSE++ library to read and write GSE waveforms
# 
# REVISIONS and CHANGES 
#    16/03/2002   V1.0   Thomas Forbriger
thomas.forbriger's avatar
thomas.forbriger committed
11
#    14/11/2002   V1.1   place doxygen docu on WWW
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 
# ============================================================================
# general part
# ------------
#

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

all: libgsexx.a doxybrief doxyfull

flist: Makefile README $(wildcard *.h *.cc *.cfg)
	echo $^ | tr ' ' '\n' | sort > $@

.PHONY: edit
edit: flist; vim $<

.PHONY: clean
clean: ; 
	-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
35
	-/bin/rm -vf flist *.d *.o gsexx_tests
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=gsexx.cc gsexx_TCHK2.cc gsexx_TWID2.cc gsexx_TSTA2.cc gsexx_TDAT2.cc \
       gsexx_cm6.cc
INCSRC=gsexx.h gsexx_diff.h gsexx_TDAT2.h
54
55
56
57
58
59
60
61

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

libgsexx.a: $(patsubst %.cc,%.o,$(LIBSRC))
	ar rcv $@ $^
	ranlib $@
	newlib $@

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

#======================================================================
# documentation part
# ------------------
thomas.forbriger's avatar
thomas.forbriger committed
67
DOXYWWWPATH=$(HOME)/public_html/txt/cxx/libgsexx
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=README $(LIBSRC) $(INCSRC) gsexx_tests.cc
73

thomas.forbriger's avatar
thomas.forbriger committed
74
75
76
77
78
doc/%: doxyfull.cfg $(DOXYSRC)
	mkdir -vp $(DOXYWWWPATH)
	ln -sfv $(DOXYWWWPATH) doc
	doxygen $<

79
80
81
82
83
84
85
86
87
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

thomas.forbriger's avatar
thomas.forbriger committed
88
89
doxyfullview: doxyfull; mozilla file:$(DOXYWWWPATH)/html/index.html &
doxybriefview: doxybrief; mozilla file:/docbrief/html/index.html &
90
91
doxyview: doxyfullview doxybrief

92
93
94
95
#======================================================================
# test code
# ---------

thomas.forbriger's avatar
thomas.forbriger committed
96
97
gsexx_tests: gsexx_tests.cc
	$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lgsexx -L$(LOCLIBDIR)
98
99
tests: gsexx_tests; $<

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