Fix Makefile Targets
@@ -28,16 +28,16 @@ if [ -d "${TOPWD}/.git" ]; then
git_dirty=true
fi
- VERSION_FLAG="-ldflags -X github.com/aws/amazon-ecs-init/ecs-init/version.Version=${version}"
- GIT_HASH_FLAG="-ldflags -X github.com/aws/amazon-ecs-init/ecs-init/version.GitShortHash=${git_hash}"
- GIT_DIRTY_FLAG="-ldflags -X github.com/aws/amazon-ecs-init/ecs-init/version.GitDirty=${git_dirty}"
+ VERSION_FLAG="-X github.com/aws/amazon-ecs-init/ecs-init/version.Version=${version}"
+ GIT_HASH_FLAG="-X github.com/aws/amazon-ecs-init/ecs-init/version.GitShortHash=${git_hash}"
+ GIT_DIRTY_FLAG="-X github.com/aws/amazon-ecs-init/ecs-init/version.GitDirty=${git_dirty}"
fi
mkdir -p "${SRCPATH}"
ln -s "${TOPWD}/ecs-init" "${SRCPATH}"
cd "${SRCPATH}/ecs-init"
if [[ "$1" == "dev" ]]; then
- go build -tags 'development' "${VERSION_FLAG} ${GIT_HASH_FLAG} ${GIT_DIRTY_FLAG}" \
+ go build -tags 'development' -ldflags "${VERSION_FLAG} ${GIT_HASH_FLAG} ${GIT_DIRTY_FLAG}" \
-o "${TOPWD}/amazon-ecs-init"
else
tags=""
@@ -45,7 +45,7 @@ else
tags="-tags '$1'"
fi
CGO_ENABLED=0 go build -a ${tags} -x -ldflags '-s' \
- ${VERSION_FLAG} ${GIT_HASH_FLAG} ${GIT_DIRTY_FLAG} \
+ -ldflags "${VERSION_FLAG} ${GIT_HASH_FLAG} ${GIT_DIRTY_FLAG}" \
-o "${TOPWD}/amazon-ecs-init"
fi
rm -r "${BUILDDIR}"
