2023-02-22 18:16:46 +00:00
|
|
|
TARGETNAME = inverter
|
2021-12-02 20:57:19 +00:00
|
|
|
BUILDFOLDER = ./build/
|
|
|
|
TARGET = $(BUILDFOLDER)$(TARGETNAME)
|
|
|
|
|
2023-03-03 17:17:00 +00:00
|
|
|
TEST_TARGETNAME = test
|
|
|
|
TEST_BUILDFOLDER = ./test/build/
|
|
|
|
TEST_TARGET = $(TEST_BUILDFOLDER)$(TEST_TARGETNAME)
|
|
|
|
|
2023-02-22 18:16:46 +00:00
|
|
|
INC = -Isrc/include -I/usr/include -I/usr/include/libftdi1
|
2023-03-03 17:17:00 +00:00
|
|
|
CFLAGS = -Wall -Wpedantic -Wextra -g
|
2023-02-22 18:16:46 +00:00
|
|
|
CPPFLAGS =
|
2021-12-02 20:57:19 +00:00
|
|
|
|
|
|
|
SRC = $(wildcard src/*.c)
|
2023-03-03 17:17:00 +00:00
|
|
|
TEST_SRC = $(filter-out src/main.c, $(SRC) $(wildcard test/*.c))
|
2021-12-02 20:57:19 +00:00
|
|
|
|
2023-03-03 17:17:00 +00:00
|
|
|
$(TARGETNAME): $(TARGET)
|
2021-12-02 20:57:19 +00:00
|
|
|
|
|
|
|
$(TARGET): $(SRC)
|
2023-03-03 22:22:21 +00:00
|
|
|
mkdir -p $(BUILDFOLDER)
|
2023-03-03 17:17:00 +00:00
|
|
|
cc -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(INC) -lm -lftdi1
|
|
|
|
|
|
|
|
$(TEST_TARGETNAME): $(TEST_TARGET)
|
|
|
|
|
|
|
|
$(TEST_TARGET): $(TEST_SRC)
|
|
|
|
mkdir -p $(TEST_BUILDFOLDER)
|
|
|
|
cc -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(INC) -lm -lftdi1 -lcunit
|
2021-12-02 20:57:19 +00:00
|
|
|
|
|
|
|
clean:
|
2023-03-03 22:22:21 +00:00
|
|
|
rm -fr ./src/*.o $(BUILDFOLDER)*
|
2023-03-03 17:17:00 +00:00
|
|
|
rm -fr $(TEST_BUILDFOLDER)*
|