Browse Source

create build directory if it does not exist in Makefile

Helmut Pozimski 4 years ago
parent
commit
af32299845
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Makefile

+ 4 - 1
Makefile

@@ -4,7 +4,7 @@
 
 CC ?= gcc
 CFLAGS ::= $(CFLAGS) -std=c99 -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -D_POSIX_C_SOURCE -Wall -pedantic
-DEPS = src/wavfile.h src/tcpserver.h
+DEPS = src/wavfile.h src/tcpserver.h build
 PREFIX ?= /usr/local
 
 build/%.o: src/%.c $(DEPS)
@@ -13,6 +13,9 @@ build/%.o: src/%.c $(DEPS)
 build/tpr: build/wavfile.o build/main.o build/tcpserver.o
 	$(CC) -o build/tpr build/wavfile.o build/main.o build/tcpserver.o
 
+build:
+	mkdir build
+
 all:
 	build/tpr