Skip to content

Instantly share code, notes, and snippets.

@koenbok
Created February 13, 2016 11:36
Show Gist options
  • Select an option

  • Save koenbok/4e579e9686b4f3999d69 to your computer and use it in GitHub Desktop.

Select an option

Save koenbok/4e579e9686b4f3999d69 to your computer and use it in GitHub Desktop.
Updating subprojects in Makefiles
# Preferred way to deal with subprojects, because we want to avoid submodules.
# This way we do everything explicitly, and can verify everything in commits.
# We need to always keep master in good condition.
TMP = ./tmp
PROJECT_TEMP = $(TMP)/FramerSketch
PROJECT_GIT = git@github.com:motif/FramerSketch2.git
update%project:
@mkdir -p $(TMP)
@if ! cd $(PROJECT_TEMP)/.git; then git clone $(PROJECT_GIT) $(PROJECT_TEMP); fi
cd $(PROJECT_TEMP); git reset --hard; git pull
cd $(PROJECT_TEMP); make build
# Copy over any files, for example
rm -rf ExtraResources/project
cp -rf $(PROJECT_TEMP)/build ExtraResources/project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment