Skip to content

Commit

Permalink
Fix #92: Don't copy files over themselves.
Browse files Browse the repository at this point in the history
Installing to the source tree is explicitly supported.

In these cases, "make install" is not supposed to copy index.html;
without a CDN, it should not copy anything at all. Otherwise, cp
will return errors because the origin and destination are identical.
In that case, "install" should merely be an alias to "all".

Add a check for CDN_PREFIX and PREFIX, and make the install target behave
accordingly.
  • Loading branch information
cburschka committed Mar 27, 2014
1 parent b81e5b7 commit 8171ef1
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,23 @@ distclean: clean
rm .config.vars
rm Makefile

install: all install-init install-js install-css-global
ifneq (.,${CDN_PREFIX})
install: all install-cdn
ifneq (.,${PREFIX})
mkdir -p "${PREFIX}"
$(CP) -au index.html "${PREFIX}/"
endif
$(CP) -au "${SRC_PATH}/css/alt" "${CDN_PREFIX}/css/"
$(CP) -au "${SRC_PATH}/img" "${SRC_PATH}/sounds" "${CDN_PREFIX}/"
$(CP) -au index.html "${PREFIX}/"
else
install: all
endif
touch -a "${PREFIX}/config.custom.js"

install-cdn: install-init install-js install-css-global

install-init:
mkdir -p "${CDN_PREFIX}/css/" "${CDN_PREFIX}/js/" "${PREFIX}"
mkdir -p "${CDN_PREFIX}/css/" "${CDN_PREFIX}/js/"

ifeq (${MODE},debug)
install-js: install-js-core install-js-lib
Expand Down

0 comments on commit 8171ef1

Please sign in to comment.