Makefile 2.29 KB
Newer Older
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
3
# $Id: Makefile,v 1.2 2002-03-25 22:04:06 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

#======================================================================
# 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

69
DOXYSRC=README gsexx.h gsexx.cc gsexx_tests.cc
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

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

85
86
87
88
89
90
91
#======================================================================
# test code
# ---------

gsexx_tests: gsexx_tests.cc; $(CXX) -o $@ $< -I$(LOCINCLUDEDIR)
tests: gsexx_tests; $<

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