Makefile 2.64 KB
Newer Older
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
3
# $Id: Makefile,v 1.8 2006-01-25 09:44:12 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
# 
# ============================================================================
# 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
25
all: install doxybrief doxyfull
install: install-include libgsexx.a
26
27
28
29
30
31
32
33
34
35

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
36
	-/bin/rm -vf flist *.d *.o gsexx_tests
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

#======================================================================
# 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
52
53
54
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
55
56
57
58
59
60
61
62

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

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

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

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

doxyclean: ;/bin/rm -rfv doc docbrief

thomas.forbriger's avatar
thomas.forbriger committed
73
DOXYSRC=README $(LIBSRC) $(INCSRC) gsexx_tests.cc
74

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

80
81
82
83
84
85
86
87
88
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
89
90
doxyfullview: doxyfull; mozilla file:$(DOXYWWWPATH)/html/index.html &
doxybriefview: doxybrief; mozilla file:/docbrief/html/index.html &
91
92
doxyview: doxyfullview doxybrief

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

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

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