Skip to content

Commit

Permalink
update Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Lewis <ianmlewis@gmail.com>
  • Loading branch information
ianlewis committed Nov 17, 2024
1 parent b1b4951 commit fa8b3ee
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2024 Ian Lewis
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -71,8 +72,8 @@ go-benchmark: ## Runs Go benchmarks.
## Tools
#####################################################################

.PHONY: autogen
autogen: ## Runs autogen on code files.
.PHONY: license-headers
license-headers: ## Update license headers.
@set -euo pipefail; \
files=$$( \
git ls-files \
Expand All @@ -83,13 +84,19 @@ autogen: ## Runs autogen on code files.
'*.yaml' '**/*.yaml' \
'*.yml' '**/*.yml' \
); \
name=$$(git config user.name); \
if [ "$${name}" == "" ]; then \
>&2 echo "git user.name is required."; \
>&2 echo "Set it up using:"; \
>&2 echo "git config user.name \"John Doe\""; \
fi; \
for filename in $${files}; do \
if ! ( head "$${filename}" | grep -iL "Copyright" > /dev/null ); then \
autogen -i --no-code --no-tlc -c "Google LLC" -l apache "$${filename}"; \
autogen -i --no-code --no-tlc -c "$${name}" -l apache "$${filename}"; \
fi; \
done; \
if ! ( head Makefile | grep -iL "Copyright" > /dev/null ); then \
autogen -i --no-code --no-tlc -c "Google LLC" -l apache Makefile; \
autogen -i --no-code --no-tlc -c "$${name}" -l apache Makefile; \
fi;

.PHONY: format
Expand Down

0 comments on commit fa8b3ee

Please # to comment.