Makefile 2.08 KB
Newer Older
1
2
3
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.1 2002-03-17 21:26:27 forbrig Exp $
# 
# 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
	-/bin/rm -vf flist *.d *.o

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

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

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

LIBSRC=gsexx.cc
INCSRC=gsexx.h

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

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

install-include: ; newinclude $(INCSRC)

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

doxyclean: ;/bin/rm -rfv doc docbrief

DOXYSRC=README gsexx.h gsexx.cc

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

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