Makefile 2.42 KB
Newer Older
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
3
# $Id: Makefile,v 1.3 2002-03-29 23:35:48 forbrig Exp $
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 
# 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
# 
# ============================================================================
# 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
34
	-/bin/rm -vf flist *.d *.o gsexx_tests
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

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

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

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

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

#======================================================================
# documentation part
# ------------------
.PHONY: doxyclean doxyview doxybriefview doxyfullconf doxybriefconf

doxyclean: ;/bin/rm -rfv doc docbrief

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

doc/%: doxyfull.cfg $(DOXYSRC); 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; netscape doc/html/index.html &
doxybriefview: doxybrief; netscape docbrief/html/index.html &
doxyview: doxyfullview doxybrief

86
87
88
89
#======================================================================
# test code
# ---------

thomas.forbriger's avatar
thomas.forbriger committed
90
91
gsexx_tests: gsexx_tests.cc
	$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lgsexx -L$(LOCLIBDIR)
92
93
tests: gsexx_tests; $<

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