1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2024-12-23 09:16:11 +00:00

Improve makefile

- Define PHONY targets
 - Set optimization level O2
 - Move C++ standard flag to CFLAGS
 - Remove superfluous targets
This commit is contained in:
Alexander Koch 2016-06-16 20:14:52 +02:00
parent 7db5c2a8e4
commit 0eb7349cad

View File

@ -1,18 +1,17 @@
CC=g++ CC=g++
CFLAGS= CFLAGS=-Wall -O2 -std=gnu++11
LDFLAGS=-std=gnu++11 -lusb-1.0 LDFLAGS=-lusb-1.0
PROGN=g810-led
all: make bin/g810-led .PHONY: all clean
make: all: bin/$(PROGN)
rm -rf bin
mkdir bin
bin/g810-led: src/main.cpp src/classes/*
$(CC) -o $@ $^ $(LDFLAGS) bin/$(PROGN): src/main.cpp src/classes/*.cpp
@mkdir -p bin
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS)
clean: clean:
rm -rf *.o rm -rf bin
mrproper: clean
rm -rf $(EXEC)