mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
>[...] changes to the APE environment had broken Discount builds >there. The compiler is being choosy in a new way about *snprintf, >and no longer liked Csio.c:29. > >Working around this takes a one-line edit in Plan9/mkfile, as shown >in the attached patch, and results in a clean build, passes tests, >etc. > >Long form explanation from the APE docs, for curiosity's sake: > >>_C99_SNPRINTF_EXTENSION >>This extension permits the use of the return values of .I snprintf >>and .I vsnprintf . Before C99, the 1999 C standard, these functions >>usually returned the number of bytes, excluding terminating NUL, >>actually stored in the target string. (GNU, as usual, had to be >>different and returned -1 if the target string was too small.) C99 >>requires them to instead return the number of bytes, excluding >>terminating NUL, that would have been written into the target string >>if it were infinitely large or a negative value if an `encoding >>error' occurs, so old programs compiled under C99 rules will be >>prone to overrunning their buffers. This extension is a way for the >>programmer to declare that he or she understands the situation and >>has adjusted the code being compiled to compensate.
38 lines
746 B
Makefile
38 lines
746 B
Makefile
BIN=/$objtype/bin
|
|
CC='cc -D_BSD_EXTENSION -D_C99_SNPRINTF_EXTENSION'
|
|
|
|
markdown:
|
|
ape/psh -c 'cd .. && make'
|
|
|
|
none:V: markdown
|
|
|
|
test: markdown
|
|
ape/psh -c 'cd ..&& make test'
|
|
|
|
install: markdown
|
|
cp ../markdown $BIN/markdown
|
|
|
|
install.progs: install
|
|
cp ../makepage $BIN/makepage
|
|
cp ../mkd2html $BIN/mkd2html
|
|
|
|
install.libs: install
|
|
cp ../mkdio.h /sys/include/ape/mkdio.h
|
|
cp ../libmarkdown.a /$objtype/lib/ape/libmarkdown.a
|
|
|
|
install.man: install
|
|
cp markdown.1 /sys/man/1/markdown
|
|
cp markdown.2 /sys/man/2/markdown
|
|
cp markdown.6 /sys/man/6/markdown
|
|
|
|
installall:V: install.libs install.man install.progs
|
|
|
|
config:
|
|
ape/psh -c 'cd .. && ./configure.sh $CONFIG'
|
|
|
|
clean:
|
|
ape/psh -c 'cd .. && make clean'
|
|
|
|
nuke:
|
|
ape/psh -c 'cd .. && make distclean'
|