Skip to content

Commit 779d7e8

Browse files
committed
Install should be more portable now
1 parent 15e4c8d commit 779d7e8

File tree

4 files changed

+20
-45
lines changed

4 files changed

+20
-45
lines changed

Makefile.in

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,51 +32,45 @@ CXX_FLAGS=-std=c++11 $(CXX_WARN) $(CXX_NOWARN) $(CXX_OPT) $(CXX_INCLUDE) $(CXX_P
3232
LD_PLATFORM_LIBS=%LD_PLATFORM_LIBS_IN%
3333
LD_LIBS=-lcurl $(LD_PLATFORM_LIBS)
3434

35-
COLOR_OFF="$(shell tput sgr0)"
36-
COLOR_GREEN="$(shell tput setaf 2)"
37-
ECHO_PREFIX="$(COLOR_GREEN)»»»$(COLOR_OFF)"
38-
3935
.PHONY: all setup clean stdman stdman_setup stdman_link
4036

4137
.SILENT:
4238

4339
all: setup stdman
44-
echo "$(ECHO_PREFIX) Success"
40+
echo "Success"
4541

4642
setup: clean
47-
echo "$(ECHO_PREFIX) Preparing"
43+
echo "Preparing"
4844
mkdir -p obj bin man tmp
4945

5046
clean:
5147
rm -f bin/stdman
5248
rm -rf $(OBJ_DIR)
53-
echo "$(ECHO_PREFIX) Cleaned"
49+
echo "Cleaned"
5450

5551
stdman: setup stdman_link
56-
echo "$(ECHO_PREFIX) Done building stdman"
52+
echo "Done building stdman"
5753

5854
stdman_setup: setup
59-
echo "$(ECHO_PREFIX) Building stdman"
55+
echo "Building stdman"
6056

6157
stdman_link: stdman_setup $(OBJECTS)
62-
echo " $(ECHO_PREFIX) Linking"
58+
echo " Linking"
6359
$(CXX) -o $(BIN) $(BIN_OBJECTS) $(LD_LIBS)
6460

6561
%.cpp.o: %.cpp setup
66-
echo " $(ECHO_PREFIX) Compiling $<"
62+
echo " Compiling $<"
6763
mkdir -p $(addprefix $(OBJ_DIR),$(dir $<))
6864
$(CXX) $(CXX_FLAGS) $< -o $(addsuffix .o,$(addprefix $(OBJ_DIR), $<))
6965

7066
generate: stdman
71-
export echo_prefix=$(ECHO_PREFIX) &&\
7267
export tmp_man=$(TMP_MAN) &&\
7368
export reference=$(REFERENCE) &&\
7469
export threads=$(THREADS) &&\
7570
./do_generate
7671
rm -f $(TMP_MAN)/*.html
7772

7873
install:
79-
export echo_prefix=$(ECHO_PREFIX) &&\
8074
export tmp_man=$(TMP_MAN) &&\
8175
export reference=$(REFERENCE) &&\
8276
export mandir=$(DESTDIR)/$(MANDIR) &&\

configure

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,8 @@ else
3939
exit 1
4040
fi
4141

42-
# Colors
43-
COLOR_OFF="$(tput sgr0)"
44-
COLOR_RED="$(tput setaf 1)"
45-
COLOR_YELLOW="$(tput setaf 3)"
46-
COLOR_GREEN="$(tput setaf 2)"
47-
48-
# Output colorizing
49-
ECHO_PREFIX=$COLOR_GREEN"»»»"$COLOR_OFF
50-
if [ "$UNAME" = "Linux" ];
51-
then
52-
ECHO="echo -e $ECHO_PREFIX"
53-
else
54-
ECHO="echo $ECHO_PREFIX"
55-
fi
56-
57-
log() { $ECHO "$@" 1>&2; }
58-
log_start() { printf "$ECHO_PREFIX $@" 1>&2; }
42+
log() { echo "$@" 1>&2; }
43+
log_start() { printf "$@" 1>&2; }
5944
log_end() { echo "$@" 1>&2; }
6045

6146
PROJECT=stdman

do_generate

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,36 @@
1010
# XXX: Do not call this script directly: use `make generate`
1111
set -o nounset
1212

13-
# colors
14-
color_off=$(tput sgr0)
15-
color_red=$(tput setaf 1)
16-
1713
function check_existence
1814
{
19-
printf "$echo_prefix Checking for $1... "
15+
printf "Checking for $1... "
2016
which $1 > /dev/null 2>&1
2117
exists=$?
2218
if [ "$exists" -eq "0" ];
2319
then
2420
echo "found" 1>&2
2521
else
26-
echo "${color_red}not found${color_off}; make sure it's in PATH" 1>&2
27-
echo "${color_red}Error: ${color_off}manual generation will not work"
22+
echo "not found; make sure it's in PATH" 1>&2
23+
echo "Error: manual generation will not work"
2824
exit 1
2925
fi
3026
}
3127

3228
check_existence "elinks"
3329
check_existence "gzip"
3430

35-
echo "$echo_prefix Generating from $reference to $tmp_man"
36-
echo " $echo_prefix Removing previous files"
31+
echo "Generating from $reference to $tmp_man"
32+
echo " Removing previous files"
3733
rm -f $tmp_man/*.3
38-
echo " $echo_prefix Parsing documentation on $threads threads"
34+
echo " Parsing documentation on $threads threads"
3935
find $reference -name '*.html' -print0 | xargs -0 -n 1 -P $threads -I % \
4036
./bin/stdman -d $tmp_man % > /dev/null 2>&1
4137

42-
echo " $echo_prefix Removing unwanted pages"
38+
echo " Removing unwanted pages"
4339
for file in $(find $tmp_man -name '*.3' | grep -v "std::") ; do
4440
rm -f $file;
4541
done
4642

47-
echo " $echo_prefix Creating links for common typedefs"
43+
echo " Creating links for common typedefs"
4844
./do_link
49-
echo "$echo_prefix Done generating"
45+
echo "Done generating"

do_install

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
set -o errexit
1212
set -o nounset
1313

14-
echo "$echo_prefix Installing from $tmp_man to $mandir/man3"
14+
echo "Installing from $tmp_man to $mandir/man3"
1515
mkdir -p $mandir/man3
1616
for file in "$tmp_man"/*.3 ; do
1717
out=$mandir/man3/$(basename "$file");
1818
install -g 0 -o 0 -m 0644 "$file" "$out";
1919
gzip -f "$out";
2020
done
21-
echo "$echo_prefix Done"
21+
echo "Done"

0 commit comments

Comments
 (0)