Makefile: Automatically create build directory if it doesn't exist

Thu, 04 Feb 2016 17:21:33 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 04 Feb 2016 17:21:33 +0000
changeset 75
68259c995b56
parent 74
b3f2711684a7
child 76
fecc1af937be

Makefile: Automatically create build directory if it doesn't exist

Makefile file | annotate | diff | comparison | revisions
--- a/Makefile	Fri Jan 01 21:28:16 2016 +0000
+++ b/Makefile	Thu Feb 04 17:21:33 2016 +0000
@@ -7,14 +7,17 @@
 SOURCE_FILES=$(shell $(SQUISH) --list-files)
 MISSING_FILES=$(shell $(SQUISH) --list-missing-files)
 
-OUTPUT=scansion.bin
+OUTPUT=build/scansion
 
 BIN_DIR=$(PREFIX)/bin
 
 all: $(OUTPUT)
 
-$(OUTPUT): squishy $(SOURCE_FILES)
-	$(SQUISH)
+$(OUTPUT): build squishy $(SOURCE_FILES)
+	$(SQUISH) --output=$(OUTPUT)
+
+build:
+	mkdir build
 
 install: $(OUTPUT)
 	install -t $(BIN_DIR) -m 655 $^

mercurial