Skip to content

Commit

Permalink
FreeBSD: Support different stat format in Makefile.webui.
Browse files Browse the repository at this point in the history
The stat program on FreeBSD requires different arguments to GNU
stat. In the past, this is done by the ports patching the Makefile
post-extract.

Instead, we'll configure the program's arguments based on platform.
We'll also use %z (filesize) instead of the port's %b (file blocks) so
we generate equivalent output to the Linux version..
  • Loading branch information
azlm8t authored and perexg committed Sep 20, 2018
1 parent 3cf9451 commit b251fea
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Makefile.webui
Expand Up @@ -45,6 +45,12 @@ else
DEBUG = -debug
endif

ifeq ($(PLATFORM), freebsd)
STAT_ARG=-f "%-35N %7z"
else
STAT_ARG=--printf="%-35n %7s\n"
endif

JAVASCRIPT =
JAVASCRIPT2 =
JAVASCRIPT_TV =
Expand Down Expand Up @@ -194,22 +200,22 @@ define GO_JS
$(VV)$(CSS_PY) --in="$^" utf-check
$(VV)cat $^ > $@.tmp
$(VV)$(RUN_JS) < $@.tmp > $@.tmp2
@stat --printf="%-35n %7s\n" $@.tmp $@.tmp2
@stat $(STAT_ARG) $@.tmp $@.tmp2
$(VV)$(GZIPCMD) -c $@.tmp2 > $@.tmp
@rm $@.tmp2
@mv $@.tmp $@
@stat --printf="%-35n %7s\n" $@
@stat $(STAT_ARG) $@
endef

define GO_CSS
$(VV)$(CSS_PY) --in="$^" utf-check
$(VV)$(CSS_PY) --in="$^" > $@.tmp
$(VV)$(RUN_CSS) < $@.tmp > $@.tmp2
@stat --printf="%-35n %7s\n" $@.tmp $@.tmp2
@stat $(STAT_ARG) $@.tmp $@.tmp2
$(VV)$(GZIPCMD) -c $@.tmp2 > $@.tmp
@rm $@.tmp2
@mv $@.tmp $@
@stat --printf="%-35n %7s\n" $@
@stat $(STAT_ARG) $@
endef

define merge-po
Expand Down

0 comments on commit b251fea

Please sign in to comment.