Skip to content

Commit

Permalink
Makefile: Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean-StarLabs committed Oct 9, 2023
1 parent a019a87 commit e365a4a
Showing 1 changed file with 26 additions and 42 deletions.
68 changes: 26 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ $(OUTPUT_DIR)/$(version).$(file_type): $(version).$(file_type)
$(OUTPUT_DIR)/$(sku).$(target).metainfo.xml: $(OUTPUT_DIR)
printf '$(metadata)' > $@

$(OUTPUT_DIR)/$(target)-$(sku).cab: $(OUTPUT_DIR)/$(sku).$(target).metainfo.xml \
$(OUTPUT_DIR)/$(target)-$(sku).cab: $(OUTPUT_DIR)/$(sku).$(target).metainfo.xml \
$(OUTPUT_DIR)/$(version).$(file_type)
gcab -cn $@ $^

# EFI Shell
$(OUTPUT_DIR)/startup.nsh: $(OUTPUT_DIR)
printf '$(nsh_script)' > $@

$(OUTPUT_DIR)/efi-$(sku).zip: $(OUTPUT_DIR)/startup.nsh \
$(OUTPUT_DIR)/$(version).$(file_type) \
$(OUTPUT_DIR)/efi-$(sku).zip: $(OUTPUT_DIR)/startup.nsh \
$(OUTPUT_DIR)/$(version).$(file_type) \
binaries/$(nsh_tool).efi
zip -rj $@ $^

Expand All @@ -59,82 +59,66 @@ $(OUTPUT_DIR)/efi-$(sku).zip: $(OUTPUT_DIR)/startup.nsh \
$(OUTPUT_DIR)/release_notes.md: $(OUTPUT_DIR)
nano $(OUTPUT_DIR)/release_notes.md

meta_release_notes = $(shell while IFS= read -r line; do \
printf '\\t\\t\\t\\t\\t<li>%s</li>\\n' "$$line"; \
meta_release_notes = $(shell while IFS= read -r line; do \
printf '\\t\\t\\t\\t\\t<li>%s</li>\\n' "$$line"; \
done <$(OUTPUT_DIR)/release_notes.md)

nsh_release_notes = $(shell while IFS= read -r line; do \
printf 'echo "%s"\\n' "$$line"; \
nsh_release_notes = $(shell while IFS= read -r line; do \
printf 'echo "%s"\\n' "$$line"; \
done <$(OUTPUT_DIR)/release_notes.md)

readme_release_notes = $(shell while IFS= read -r line; do \
printf '> %s\\n' "$$line"; \
readme_release_notes = $(shell while IFS= read -r line; do \
printf '> %s\\n' "$$line"; \
done <$(OUTPUT_DIR)/release_notes.md)

link = https://github.com/StarLabsLtd/firmware/raw/master/$(OUTPUT_DIR)

# Master recipes to be called
ami-flashrom: $(OUTPUT_DIR) \
$(OUTPUT_DIR)/release_notes.md \
$(OUTPUT_DIR)/$(version).$(file_type) \
ami-flashrom: $(OUTPUT_DIR) \
$(OUTPUT_DIR)/release_notes.md \
$(OUTPUT_DIR)/$(version).$(file_type) \
$(OUTPUT_DIR)/$(target)-$(sku).cab

printf "\n#### $(target): [$(version)]($(link)/$(version).$(file_type)) $(date)\n" >> $(subst $() $(),/,$(name))/README.md
printf '$(readme_release_notes)\n' >> $(subst $() $(),/,$(name))/README.md
git add $(OUTPUT_DIR) $(subst $() $(),/,$(name))/README.md
git commit -m "Added $(name) $(target) $(version)"
git push

ami: $(OUTPUT_DIR) \
$(OUTPUT_DIR)/release_notes.md \
$(OUTPUT_DIR)/$(version).$(file_type) \
$(OUTPUT_DIR)/$(target)-$(sku).cab \
ami: $(OUTPUT_DIR) \
$(OUTPUT_DIR)/release_notes.md \
$(OUTPUT_DIR)/$(version).$(file_type) \
$(OUTPUT_DIR)/$(target)-$(sku).cab \
$(OUTPUT_DIR)/efi-$(sku).zip

printf "\n#### $(target): [$(version)]($(link)/efi-$(sku).zip) $(date)\n" >> $(subst $() $(),/,$(name))/README.md
printf '$(readme_release_notes)\n' >> $(subst $() $(),/,$(name))/README.md
git add $(OUTPUT_DIR) $(subst $() $(),/,$(name))/README.md
git commit -m "Added $(name) $(target) $(version)"
git push

coreboot: $(OUTPUT_DIR) \
$(OUTPUT_DIR)/release_notes.md \
$(OUTPUT_DIR)/$(version).$(file_type) \
coreboot: $(OUTPUT_DIR) \
$(OUTPUT_DIR)/release_notes.md \
$(OUTPUT_DIR)/$(version).$(file_type) \
$(OUTPUT_DIR)/$(target)-$(sku).cab

printf "\n#### $(target): [$(version)]($(link)/$(target)-$(sku).cab) $(date)\n" >> $(subst $() $(),/,$(name))/README.md
printf '$(readme_release_notes)\n' >> $(subst $() $(),/,$(name))/README.md
git add $(OUTPUT_DIR) $(subst $() $(),/,$(name))/README.md
git commit -m "Added $(name) $(target) $(version)"
git push

ite: $(OUTPUT_DIR) \
$(OUTPUT_DIR)/release_notes.md \
$(OUTPUT_DIR)/$(version).$(file_type) \
ite: $(OUTPUT_DIR) \
$(OUTPUT_DIR)/release_notes.md \
$(OUTPUT_DIR)/$(version).$(file_type) \
$(OUTPUT_DIR)/efi-$(sku).zip

printf "\n#### $(target): [$(version)]($(link)/efi-$(sku).zip) $(date)\n" >> $(subst $() $(),/,$(name))/README.md
printf '$(readme_release_notes)\n' >> $(subst $() $(),/,$(name))/README.md
git add $(OUTPUT_DIR) $(subst $() $(),/,$(name))/README.md
git commit -m "Added $(name) $(target) $(version)"
git push


blog = ---\n
blog += layout: post\n
blog += title: $(name) $(target) $(version)\n
blog += description: >\n
blog += $(target) firmware, version $(version) added for $(name).\n
blog += image:\n
blog += path: /assets/img/$(model.jpg)\n
blog += sitemap: false\n
blog += hide_last_modified: true\n
blog += ---\n
blog += \n
blog += readme_release_notes

blog:
printf '$(blog)\n' >> docs/_posts/$(date)_$(name)_$(target)_$(version).md

clean:
rm -rf build

help:
printf "Star Labs Firmware\n\n"
printf "Usage\n"
Expand Down

0 comments on commit e365a4a

Please sign in to comment.