Skip to content

Commit

Permalink
Merge pull request #45 from pullreq/master
Browse files Browse the repository at this point in the history
Makefile assignments, explanative comments.
  • Loading branch information
cosmin committed Mar 18, 2014
2 parents 978371f + cbee707 commit c003ca2
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions Makefile
Expand Up @@ -7,26 +7,40 @@ LIBEXECDIR=$(PREFIX)/lib
GITHGEXECDIR=$(LIBEXECDIR)/git-hg
FASTEXPORTDIR=$(GITHGEXECDIR)/fast-export

INSTALL="$(which install) -c"
# INSTALL=$$(which install) -c # Shell in makefiles must use $$, not $. But
# SED=$$(which sed) # <--- this is redundant, since make will use the first
# utility of that name in the $PATH anyway.
# SED = gsed # <-- The reason to set these (at all) would be to allow this.
# Also, you can't quote arguments in an assignment or they aren't expanded.

INSTALL = install -c
SED = sed

GITHG_S=bin/git-hg
GITHG_F=$(BUILDDIR)/git-hg
HGFE_D=fast-export
HGFE_F=$(HGFE_D)/hg-fast-export.sh $(HGFE_D)/hg-fast-export.py $(HGFE_D)/hg2git.py

all: $(GITHG_F) $(HGFE_F)
all: $(GITHG_F)

clean:
rm -rf $(BUILDDIR)

$(GITHG_F): $(GITHG_S)
distclean: clean
rm -rf $(HGFE_D)
git clean -dxf

$(GITHG_F): $(HGFE_D)
rm -rf $(HGFE_D)
git submodule update --init
mkdir -p $(BUILDDIR)
sed 's|GITHG_HOME=.*|GITHG_HOME=$(GITHGEXECDIR)|g' $< > $@
$(SED) 's|GITHG_HOME=.*|GITHG_HOME=$(GITHGEXECDIR)|' $< > $@

$(HGFE_F):
$(HGFE_D):
rm -rf $(HGFE_D)
git submodule update --init

install:
install: all
$(INSTALL) -d $(DESTDIR)$(BINDIR)
$(INSTALL) -m 755 $(GITHG_F) $(DESTDIR)$(BINDIR)/
$(INSTALL) -d $(DESTDIR)$(FASTEXPORTDIR)
Expand Down

0 comments on commit c003ca2

Please sign in to comment.