-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
20 lines (18 loc) · 753 Bytes
/
Makefile
File metadata and controls
20 lines (18 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Creates links from `$srcdir/*.c[ls]s` to `Styles/*.c[ls]s`.
# Also links associated python filters.
#
# Example usage from within another Makefile:
#
# archivestyle: ; $(MAKE) -f ArchiveStyle/Makefile
# .PHONY: archivestyle
SHELL = /bin/sh
srcdir := $(patsubst %/Makefile,%,$(lastword $(MAKEFILE_LIST)))
archivesrcs := $(wildcard $(srcdir)/*.c[ls]s)
archivepys := $(foreach src,$(sort $(basename $(archivesrcs))),$(wildcard $(patsubst %,%.py,$(src))))
archivestyles := $(patsubst $(srcdir)/%,Styles/%,$(archivesrcs) $(archivepys))
archive: $(archivestyles);
$(archivestyles): Styles/%: $(srcdir)/%
[[ -d Styles ]] || mkdir Styles
ln -fs "$(realpath $<)" $@
clobber distclean gone: ; rm -f $(archivestyles)
.PHONY: archive clobber distclean gone