@@ -15,7 +15,7 @@
1515# You can also edit the generated version of this file directly.
1616#
1717PCC := {bin/pcc} # example: /usr/local/bin/pcc
18−PURESCRIPT_PKGS := packages # example: bower_components
18+PURESCRIPT_PKGS := .psc-package
1919PURESCRIPT_SRC := src
2020OUTPUT := output
2121BIN := main
@@ -33,9 +33,6 @@ endif
3333DEBUG := "-DDEBUG -g"
3434RELEASE := "-O3 -flto"
3535
36−PURESCRIPT_PKG_SRCS := $(shell find $(PURESCRIPT_PKGS) -name '*.purs' | grep -v \/test\/ | grep -v \/example\/ | grep -v \/examples\/)
37−PURESCRIPT_SRCS := $(shell find $(PURESCRIPT_SRC) -name '*.purs')
38−
3936INCLUDES := -I $(OUTPUT)
4037BIN_DIR := $(OUTPUT)/bin
4138
@@ -45,15 +42,16 @@ release: codegen
4542debug: codegen
4643 @$(MAKE) $(BIN) CXXFLAGS+=$(DEBUG)
4744
48−release-object: codegen
49− @$(MAKE) $(OBJ) CXXFLAGS+=$(RELEASE)
50−
51−debug-object: codegen
52− @$(MAKE) $(OBJ) CXXFLAGS+=$(DEBUG)
53−
54−codegen:
45+codegen: PURESCRIPT_PKG_SRCS=$(shell find $(PURESCRIPT_PKGS) -name '*.purs' | grep -v \/test\/ | grep -v \/example\/ | grep -v \/examples\/)
46+codegen: PURESCRIPT_SRCS=$(shell find $(PURESCRIPT_SRC) -name '*.purs')
47+#
48+codegen: .psc-package
5549 @$(PCC) $(PCCFLAGS) --output $(OUTPUT) $(PURESCRIPT_PKG_SRCS) $(PURESCRIPT_SRCS)
5650
51+.psc-package:
52+ @echo "Getting packages using 'psc-package'..."
53+ @-psc-package update
54+
5755SRCS := $(shell find $(OUTPUT) 2>/dev/null -name '*.cc')
5856
5957OBJS = $(SRCS:.cc=.o)