-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
60 lines (45 loc) · 1.94 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
include Makefile.in
MANUAL_HTML:=$(shell tail -n +3 Manual.book)
MANUAL_IMAGES=$(wildcard .manual/*.jpg) \
$(shell find Receiver -name \*.jpg)
Assembly = Receiver/Assembly Forend/Assembly
Components = Frame Receiver Stock Lower FCG
Minuteman = $(foreach Component,$(Components),$(wildcard Receiver/$(Component)/Prints/*.stl)) \
$(foreach Component,$(Components),$(wildcard Receiver/$(Component)/Fixtures/*.stl)) \
$(foreach Component,$(Components),$(wildcard Receiver/$(Component)/Projections/))
Forends = $(filter-out Forend/Assembly/%, \
$(shell find Forend/ -ipath '*_*/Prints/*.stl' ) \
$(shell find Forend/ -ipath '*_*/Fixtures/*.stl' ) \
$(shell find Forend/ -ipath '*_*/Projections/*.dxf'))
ZIP_TARGETS:=changelog.txt Manual.pdf Liberator12k-source/
TARGETS:=$(ZIP_TARGETS) Liberator12k.zip Liberator12k-source.zip Liberator12k-assembly.zip
changelog.txt:
git log --oneline > changelog.txt
Version.md:
@echo "---" > $@ && \
echo "title: #Liberator12k Manual" >> $@ && \
echo "author: Jeff Rodriguez" >> $@ && \
echo "copyright: Unlicensed" >> $@ && \
echo "version: $(GIT_DATE) $(GIT_VERSION)" >> $@ && \
echo "language: en-US" >> $@ && \
echo "subject: How-To" >> $@ && \
echo "---" >> $@
Manual.pdf: $(SUBDIRS) Version.md $(MANUAL_HTML) $(MANUAL_IMAGES)
htmldoc --batch Manual.book
Liberator12k-source/: .git
rm -rf $@ && \
git clone --depth=1 "file://$(CURDIR)" $@ && \
cd $@ && \
git remote set-url origin https://github.com/JeffreyRodriguez/Liberator12k.git
Liberator12k.zip: $(SUBDIRS) $(ZIP_TARGETS)
zip -9r $@ $(ZIP_TARGETS) $(Minuteman) $(Forends)
Liberator12k-source.zip: Liberator12k-source/
zip -9r $@ $^
Liberator12k-assembly.zip: $(SUBDIRS)
zip -9r $@ $(Assembly)
dist: $(TARGETS) $(ZIP_TARGETS)
mkdir -p dist/
cp -r *.zip $@/
clean-dir:
rm -rf $(MARKDOWN_HTML) $(TARGETS) Version.md changelog.txt Liberator12k-source/ dist/
all: $(SUBDIRS) $(TARGETS) dist