Add help target and ability to generate specific models

This commit is contained in:
Sebastiaan de Schaetzen 2023-02-17 21:19:59 +01:00
parent 37e495a321
commit 7a792f0a91

View File

@ -9,6 +9,19 @@ CONFIG = Lego.json
.PHONY: all
all: models thumbnails
.PHONY: help
help:
@echo Targets:
@echo all Builds models and thumbnails
@echo help Shows this help file
@echo clean Removes generated files
@echo models Builds all models
@echo thumbnails Generates model thumbnails
@echo webpage Generates web page
@echo MODEL Builds an STL and a PNG for the given model
@echo
@echo Available models: $(PARAMETERS)
.PHONY: clean
clean:
rm -f $(STL) $(PNG) $(INDEX)
@ -22,6 +35,8 @@ thumbnails: $(PNG)
.PHONY: webpage
webpage: thumbnails $(INDEX)
$(PARAMETERS): % : $(DESTDIR)/%.png $(DESTDIR)/%.stl
$(STL) $(PNG): $(SCAD) $(CONFIG) Makefile
mkdir -p $(@D)
openscad -o $@ -p $(CONFIG) -P $(basename $(@F)) --camera=0,0,0,60,0,135,0 --autocenter --viewall $(SCAD)