-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
37 lines (25 loc) · 829 Bytes
/
Copy pathmakefile
File metadata and controls
37 lines (25 loc) · 829 Bytes
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
SRCS=$(wildcard src/[0-9][0-9][0-9]_*.hs)
PNGS=$(subst src,pngs,$(SRCS:.hs=.png))
all: $(PNGS)
RESO?=800
AA?=2
# GHC is expected on PATH.
# With the Nix dev shell, run: nix develop --command make [target]
GHC = ghc
BUILDDIR = _build
GHC_FLAGS = -O3 -threaded -outputdir $(BUILDDIR)
TEGAMI_SRCS = $(wildcard Tegami/*.hs)
TEGAMI_STAMP = $(BUILDDIR)/tegami.stamp
# Pre-compile the Tegami library once; all image targets depend on this stamp.
$(TEGAMI_STAMP): $(TEGAMI_SRCS) | $(BUILDDIR)
$(GHC) $(GHC_FLAGS) --make -c Tegami/Shape.hs Tegami/Render.hs
touch $@
pngs/%.png: src/%.hs $(TEGAMI_STAMP) | bins
$(GHC) $(GHC_FLAGS) -o bins/$(notdir $(basename $<)) $<
./bins/$(notdir $(basename $<)) $(RESO) $(RESO) $(AA) $@ +RTS -N
$(BUILDDIR) bins:
mkdir -p $@
clean:
rm -rf $(BUILDDIR)
rm -f bins/*
rm -f pngs/*.png