32 lines
748 B
Makefile
32 lines
748 B
Makefile
TARGETNAME = inverter
|
|
BUILDFOLDER = ./build/
|
|
TARGET = $(BUILDFOLDER)$(TARGETNAME)
|
|
|
|
TEST_TARGETNAME = test
|
|
TEST_BUILDFOLDER = ./test/build/
|
|
TEST_TARGET = $(TEST_BUILDFOLDER)$(TEST_TARGETNAME)
|
|
|
|
INC = -Isrc/include -I/usr/include -I/usr/include/libftdi1
|
|
CFLAGS = -Wall -Wpedantic -Wextra -g
|
|
CPPFLAGS =
|
|
|
|
SRC = $(wildcard src/*.c)
|
|
TEST_SRC = $(filter-out src/main.c, $(SRC) $(wildcard test/*.c))
|
|
|
|
$(TARGETNAME): $(TARGET)
|
|
|
|
$(TARGET): $(SRC)
|
|
mkdir -p build
|
|
cc -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(INC) -lm -lftdi1
|
|
|
|
$(TEST_TARGETNAME): $(TEST_TARGET)
|
|
|
|
$(TEST_TARGET): $(TEST_SRC)
|
|
echo $(TEST_SRC)
|
|
mkdir -p $(TEST_BUILDFOLDER)
|
|
cc -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(INC) -lm -lftdi1 -lcunit
|
|
|
|
clean:
|
|
rm -fr ./src/*.o ./build/*
|
|
rm -fr $(TEST_BUILDFOLDER)*
|