Makefile.am 9.25 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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
###############################################################################
# $Id: Makefile.am 6950 2009-08-25 08:06:54Z hugues $
# Makefile for the PolyORB HI User's Guide
###############################################################################

C_CODE = $(srcdir)/po_hi_messages.c

H_CODE = $(srcdir)/po_hi_messages.h $(srcdir)/po_hi_time.h	\
	 $(srcdir)/po_hi_main.h $(srcdir)/po_hi_common.h	\
	 $(srcdir)/po_hi_debug.h $(srcdir)/po_hi_marshallers.h	\
	 $(srcdir)/po_hi_giop.h $(srcdir)/po_hi_gqueue.h	\
	 $(srcdir)/po_hi_transport.h $(srcdir)/po_hi_returns.h	\
	 $(srcdir)/po_hi_task.h $(srcdir)/po_hi_protocols.h	\
	 $(srcdir)/po_hi_types.h $(srcdir)/po_hi_protected.h

SRC_CODE = $(C_CODE) $(H_CODE)

DOC_CODE = $(srcdir)/activity.c $(srcdir)/deployment.h			\
	 $(srcdir)/deployment_c.c $(srcdir)/naming.c $(srcdir)/main.c	\
	 $(srcdir)/toy_types.c $(srcdir)/toy_main.c			\
	 $(srcdir)/toy_types.h $(srcdir)/data_struct.h			\
	 $(srcdir)/node_b_activity.c $(srcdir)/marshallers.c		\
	 $(srcdir)/subprograms.c

AADL_MODELS = $(srcdir)/complex_types.aadl $(srcdir)/do_ping_spg.aadl	\
	$(srcdir)/hardware.aadl $(srcdir)/node_a_model.aadl		\
	$(srcdir)/ping.aadl $(srcdir)/port_cnx.aadl			\
	$(srcdir)/processor_binding.aadl				\
	$(srcdir)/protected_object_types.aadl				\
	$(srcdir)/simple_types.aadl $(srcdir)/thread_a.aadl		\
	$(srcdir)/thread_a_full.aadl $(srcdir)/scenario_sample.aadl

FIGURES = $(srcdir)/fig/ping.eps $(srcdir)/fig/ping.pdf	\
	$(srcdir)/fig/ping.png

GUIDE = polyorb-hi-c_ug

###############################################################################

SRC_CODE_TEXIFILES = ${notdir $(SRC_CODE:.h=.h.texi) $(SRC_CODE:.c=.c.texi)}
DOC_CODE_TEXIFILES = ${notdir $(DOC_CODE:.h=.h.texi) $(DOC_CODE:.c=.c.texi)}
AADL_TEXIFILES = ${notdir $(AADL_MODELS:.aadl=.texi)}

GUIDE_TEXIFILES = polyorb-hi_ug_ref.texi $(SRC_CODE_TEXIFILES)	\
	$(DOC_CODE_TEXIFILES) $(AADL_TEXIFILES)

EXTRA_DIST= $(GUIDE_TEXIFILES) $(SRC_CODE) $(DOC_CODE) $(AADL_MODELS)	\
	$(srcdir)/CODING_GUIDELINES $(srcdir)/polyorb_hi.css		\
	$(srcdir)/conventions.texi $(srcdir)/gfdl.texi			\
	$(srcdir)/polyorb-hi_ug_ref.tex polyorb-hi_ug_ref.bbl		\
	polyorb-hi_ug_ref.aux $(srcdir)/polyorb-hi_ug.bib $(FIGURES)

info_TEXINFOS = polyorb-hi-c_ug.texi
polyorb_hi_c_ug_TEXINFOS = $(GUIDE_TEXIFILES)

SUFFIXES = .c .h .aadl .texi .sed .pdf .html

all-local: $(GUIDE_TEXIFILES) $(GUIDE).html $(GUIDE).pdf 

###############################################################################
# The target below are active only in developper mode. In package
# mode, once the files in doc/ have been packages, they are not
# overriden.

$(SRC_CODE):
	echo $(SRC_CODE_TEXINFOS)
	for file in $(C_CODE); do \
		cp -f $(top_srcdir)/src/`basename $${file}` $(srcdir); \
	done
	for file in $(H_CODE); do \
		cp -f $(top_srcdir)/include/`basename $${file}` $(srcdir); \
	done

$(DOC_CODE):
	for file in $(DOC_CODE); do \
	  cp -f $(srcdir)/code/`basename $${file}` $(srcdir); \
	done

$(AADL_MODELS):
	for file in $(AADL_MODELS); do \
	  cp -f $(srcdir)/model/`basename $${file}` $(srcdir); \
	done

###############################################################################
# The target below are used to build all elements of the documentation        
# Targets to build a bibliography from BibTex files   

polyorb-hi_ug_ref.texi: polyorb-hi_ug_ref.bbl
	@sed -e 's/~/ /g' \
	-e 's/\\[-`'\''"c^]//g' \
	-e 's/\\emdash */---/g' \
	-e 's/metapost/MetaPost/g' \
	-e 's/\\MF/Metafont/g' \
	-e 's/\\METAFONT/METAFONT/g' \
	-e 's/\\TUB/TUGboat/g' \
	-e 's/\\LaTeX/La@TeX/g' \
	-e 's/\\AMSTEX/AMS@TeX/g' \
	-e 's/\\AmSTeX/AMS@TeX/g' \
	-e 's/\\TeX/@TeX/g' \
	-e 's/\\noopsort{[^}]*}//g' \
	-e 's/[{}\]//g' \
	-e 's/@\[/{/g' \
	-e 's/@\]/}/g' \
	-e 's/@TeX/@TeX{}/g' \
	$< >$@

polyorb-hi_ug_ref.bbl: polyorb-hi_ug_ref.aux
	-TEXINPUTS="$(srcdir):.:" \
	 BIBINPUTS="$(srcdir):.:" \
	 BSTINPUTS="$(srcdir):.:" \
	   $(BIBTEX) polyorb-hi_ug_ref

polyorb-hi_ug_ref.aux: $(srcdir)/polyorb-hi_ug_ref.tex $(srcdir)/polyorb-hi_ug.bib
	rm -f polyorb-hi_ug_ref.bbl
	-TEXINPUTS="$(srcdir):.:" \
	 BIBINPUTS="$(srcdir):.:" \
	 BSTINPUTS="$(srcdir):.:" \
	   $(TEX) '\nonstopmode \input $<'

# The PolyORB HI User's Guide texi file does not provide Up links in
# @node commands, but we want to force generation of HTML
# documentation anyway.

$(GUIDE).html: $(srcdir)/$(GUIDE).texi
	$(MAKEINFO) --css-include=$(srcdir)/polyorb_hi.css --html --number-sections $(srcdir)/$(GUIDE).texi -o $(GUIDE).html
	rm -rf $(GUIDE).html/fig
	mkdir -p $(GUIDE).html/fig
	cp $(srcdir)/fig/*.png $(GUIDE).html/fig/
	INDEX_FILE="$(GUIDE).html/index.html";\
	TMP_FILE="$$INDEX_FILE.tmp"; \
	cat "$$INDEX_FILE" | sed 's/$$LastChangedDate: \([^$$]*\) \$$/Last Modified: \1/g' > "$$TMP_FILE"; \
	mv -f "$$TMP_FILE" "$$INDEX_FILE"


$(GUIDE).pdf: $(srcdir)/$(GUIDE).texi
	-$(TEXI2DVI) -o $@ --pdf $<

po_hi_doc_dir=${shell $(CYGPATH_U) '$(OCARINA_PREFIX)/share/doc/ocarina'}

install-data-local: all
	$(INSTALL) -d  $(DESTDIR)$(po_hi_doc_dir)
	$(INSTALL) -d  $(DESTDIR)$(po_hi_doc_dir)/$(GUIDE).html
	$(INSTALL) -d  $(DESTDIR)$(po_hi_doc_dir)/$(GUIDE).html/fig
	if [ -r $(GUIDE).pdf ]; then \
	  $(INSTALL_DATA) $(GUIDE).pdf  $(DESTDIR)$(po_hi_doc_dir); \
	  for f in $(GUIDE).html/*.html; do \
            $(INSTALL_DATA) $$f  $(DESTDIR)$(po_hi_doc_dir)/$(GUIDE).html; \
          done; \
	  for f in $(GUIDE).html/fig/*.png; do \
            $(INSTALL_DATA) $$f  $(DESTDIR)$(po_hi_doc_dir)/$(GUIDE).html/fig; \
          done; \
	else \
	  $(INSTALL_DATA) $(srcdir)/$(GUIDE).pdf  $(DESTDIR)$(po_hi_doc_dir); \
	  for f in $(srcdir)/$(GUIDE).html/*.html; do \
            $(INSTALL_DATA) $$f  $(DESTDIR)$(po_hi_doc_dir)/$(GUIDE).html; \
          done; \
	  for f in $(srcdir)/$(GUIDE).html/fig/*.png; do \
            $(INSTALL_DATA) $$f  $(DESTDIR)$(po_hi_doc_dir)/$(GUIDE).html/fig; \
          done; \
	fi

uninstall-local:
	rm -f $(DESTDIR)$(po_hi_doc_dir)/$(GUIDE).pdf
	rm -rf $(DESTDIR)$(po_hi_doc_dir)/$(GUIDE).html

clean-local:
	@-rm -f *.aux *.log *.dvi *.bbl *.blg *~ *.bak *.toc 
	@-rm -f ${SRC_CODE} ${DOC_CODE} ${AADL_MODELS}
	@-rm -f *.sed ${GUIDE_TEXIFILES}

realclean: clean
	@-rm -f $(GUIDE).ps $(GUIDE).pdf $(GUIDE).info \
	c.sed c.sed-stamp aadl.sed aadl.sed-stamp

DISTCLEANFILES = $(GUIDE).ps $(GUIDE).pdf $(GUIDE_TEXIFILES) \
	c.sed c.sed-stamp aadl.sed aadl.sed-stamp

###############################################################################
# Texi generation from .h and .c files
#

%.h.texi: %.h $(top_srcdir)/support/gentexifile
	$(MAKE) c.sed
	$(SHELL) $(top_srcdir)/support/gentexifile $< NOGROUP
	-@${RM} genout

%.c.texi: %.c $(top_srcdir)/support/gentexifile
	$(MAKE) c.sed
	$(SHELL) $(top_srcdir)/support/gentexifile $< NOGROUP
	-@${RM} genout

%.texi: %.aadl $(top_srcdir)/support/gentexifile
	$(MAKE) aadl.sed
	$(SHELL) $(top_srcdir)/support/gentexifile $< NOGROUP
	-@${RM} genout

C_KW = void int if switch case return char float uint8_t uint16_t	\
	struct typedef enum union

c.sed: c.sed-stamp
	echo "s/\([^@]\)@\([^@]\)/\1@@\2/g"                      >  c.sed
	echo "s/{/@{/g"	  		                         >> c.sed
	echo "s/}/@}/g"			                         >> c.sed
	echo "s/-- \(.*\)$$/-- @i{\1}/"                          >> c.sed
	echo "s/\([^-][^-][^\"]*\)\"\([^\"]*\)\"/\1\"@i{\2}\"/g" >> c.sed
	echo "s/@@/@@@@/g"                                       >> c.sed
	echo "s/_@_/_@@_/g"                                      >> c.sed
	for kw in $(C_KW); do \
		echo "s/^\([^-]* \)$$kw/\1@b{$$kw}/g"            >> c.sed; \
		echo "s/^\( *\)$$kw /\1@b{$$kw} /g"              >> c.sed; \
		echo "s/^$$kw$$/@b{$$kw}/g"                      >> c.sed; \
	done

c.sed-stamp:
	touch c.sed-stamp

AADL_KW = aadlboolean aadlinteger aadlreal aadlstring access all and	\
	annex applies binding bus calls classifier connections		\
	constant data delta device end enumeration event extends flow	\
	flows group implementation in inherit initial inverse is list	\
	memory mode modes none not of or out package parameter path	\
	port private process processor properties property provides	\
	public range reference refined refines requires server set	\
	sink source subcomponents subprogram system thread to true	\
	type units value

aadl.sed: aadl.sed-stamp
	echo "s/\([^@]\)@\([^@]\)/\1@@\2/g"                      >  aadl.sed
	echo "s/@@/@@@@/g"                                       >> aadl.sed
	echo "s/_@_/_@@_/g"                                      >> aadl.sed
	echo "s/{/\@{/g"                                         >> aadl.sed
	echo "s/}/\@}/g"                                         >> aadl.sed
	echo "s/-- \(.*\)$$/-- @i{\1}/"                          >> aadl.sed
	echo "s/\([^-][^-][^\"]*\)\"\([^\"]*\)\"/\1\"@i{\2}\"/g" >> aadl.sed
	for kw in $(AADL_KW); do \
		echo "s/^\([^-]* \)$$kw/\1@b{$$kw}/g"            >> aadl.sed; \
		echo "s/^\( *\)$$kw /\1@b{$$kw} /g"              >> aadl.sed; \
		echo "s/^$$kw$$/@b{$$kw}/g"                      >> aadl.sed; \
	done

aadl.sed-stamp:
	touch aadl.sed-stamp

dist-hook: all
	cp -r $(srcdir)/$(GUIDE).html $(srcdir)/$(GUIDE).pdf $(distdir)

debug-makefile:
	@echo "C_CODE = $(C_CODE)"
	@echo "H_CODE = $(H_CODE)"
	@echo "SRC_CODE = $(SRC_CODE)"
	@echo "DOC_CODE = $(DOC_CODE)"
	@echo "AADL_MODELS = $(AADL_MODELS)"
	@echo "FIGURES = $(FIGURES)"
	@echo "SRC_CODE_TEXIFILES = $(SRC_CODE_TEXIFILES)"
	@echo "DOC_CODE_TEXIFILES = $(DOC_CODE_TEXIFILES)"
	@echo "AADL_TEXIFILES = $(AADL_TEXIFILES)"
	@echo "GUIDE_TEXIFILES = $(GUIDE_TEXIFILES)"