Commit 023a6db4 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

ticket10: no longer strip comments from header files

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.
parent 5592c8a2
......@@ -40,6 +40,7 @@
# libseife even in cases where the main program
# doesn't need them; this is a linker issue
# 17/01/2011 V1.4 distinguish library creation and installation
# 25/01/2014 V1.5 comment stripping is removed
#
# 18.12.2010
# there is no problem with the shared library, when other libraries are linked
......@@ -82,22 +83,10 @@ LIBSRC=tsxx.cc filter.cc seifexx.cc seifeclass.cc \
INCINSTALLPATH=$(LOCINCLUDEDIR)/tsxx
LIBINSTALLPATH=$(LOCLIBDIR)
# name of headers with comments stripped off
STRIPHEADER=$(addsuffix .strip,$(notdir $(HEADERS)))
# name of installed (exported) header files
INSTHEADER=$(addprefix $(INCINSTALLPATH)/,$(notdir $(HEADERS)))
# if defined, empty lines are kept in stripped comment headers
# to synchronize line numbers
EMPTYPRINT=1
#EMPTYPRINT=0
# define this to be cat in case you do not have remcmmnt available
ifndef TF_REMCMMNT
TF_REMCMMNT=cat
endif
# whereever we find a README, we will use it
README=$(shell find . -name README)
# the frame of doxygen documentation is palced in text files
......@@ -152,23 +141,13 @@ libtsxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
#----------------------------------------------------------------------
# comment stripping
%.hd: %.h; echo $(notdir $<.strip): $< > $@
%.hd: %.h; echo $(notdir $<): $< > $@
include $(patsubst %.h,%.hd,$(HEADERS))
# first awk rule assumes that the first non-comment line starts with '#'
# and that the first (copyright) comment end with pattern "^ */"
%.h.strip:
awk 'BEGIN {hot=1;} /^ \*\// { if (hot) { hot=2; print; next;} }\
/^#/ { hot=0; } \
{ if (hot==2) { print ""; } else if (hot) { print; } }' $< > $@
$(TF_REMCMMNT) $< | awk 'BEGIN {hot=0;} \
/^ *$$/ { if ((hot) && ($(EMPTYPRINT))) { print; } next; } \
/^#/ { hot=1; } { if (hot) print; }' >> $@
#----------------------------------------------------------------------
$(INCINSTALLPATH)/%.h: %.h.strip
$(INCINSTALLPATH)/%.h: %.h
mkdir -p $(INCINSTALLPATH)
-rm -fv $@
/bin/cp -vpd $< $@
......
Markdown is supported
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