Commit 5b1d8f3a authored by Pfeiffer, Götz's avatar Pfeiffer, Götz
Browse files

A Makefile and a README file were added.

The makefile now allows hgen to be used as an EPICS support.
parent 09c3366b
# common targets here:
#
# make all: build application (here just copy the script file)
# make install: copy the script to $(INSTALL_LOCATION)/bin
# make doc: build simple documentation in html in directory "html"
# make install_doc: copy the created html file to www-csr.bessy.de
# -------------------------------------
# variables
# -------------------------------------
# install location, may be overridden on the command line e.g.
# make install INSTALL_LOCATION=/usr/local
# --> installs to /usr/local/bin
INSTALL_LOCATION = /opt/csr
# Variables for distributing the documentation, can be overridden on the
# command line
RSYNC_DIR=/home/wwwcsr/www/control/hgen
RSYNC_HOST=wwwcsr@www-csr.bessy.de
# -------------------------------------
# internal variables
# -------------------------------------
# if EPICS_HOST_ARCH is not defined we assume that we build not as an EPICS
# support but stand alone:
ifeq ($(origin EPICS_HOST_ARCH), undefined)
build_dir=bin
else
build_dir=bin/$(EPICS_HOST_ARCH)
endif
build_doc_dir=html
rsync_cmd=rsync -a -u --delete --chmod=a+r,Da+x -e "ssh " '$(1)' $(RSYNC_HOST):'$(2)'
# -------------------------------------
# targets
# -------------------------------------
all: build
install: build $(INSTALL_LOCATION)/bin/hgen.pl
build: $(build_dir)/hgen.pl
doc: $(build_doc_dir)/hgen.html
install_doc: doc
$(call rsync_cmd,html/,$(RSYNC_DIR)/html/)
clean:
rm -rf $(build_doc_dir) $(build_dir)
# -------------------------------------
# internal targets and rules
# -------------------------------------
$(build_dir)/%.pl: src/%.pl
install -D $< $@
ifneq ($(wildcard $(INSTALL_LOCATION)),)
$(INSTALL_LOCATION)/bin/%.pl: $(build_dir)/%.pl
install -D $< $@
else
$(INSTALL_LOCATION)/bin/%.pl: $(build_dir)/%.pl
@echo "cannot install to INSTALL_LOCATION $(INSTALL_LOCATION), dir doesn't exist."
endif
$(build_doc_dir)/%.html: src/%.pl
mkdir -p html
@echo "<PRE>" > $@
(perl $< -h 2>&1; true) >> $@
@echo "</PRE>" >> $@
.PHONY: all install build doc install_doc clean
About
-----
hgen.pl generates c header files from special comment in c sources.
Installation
------------
Install the script to <mydir>/bin with:
make install INSTALL_LOCATION=<mydir>
If you don't specify INSTALL_LOCATION the program will be installed to
/opt/csr/bin.
Install the documentation to www-csr.bessy.de with:
make install_doc
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment