inv-sw-linux/Makefile

31 lines
745 B
Makefile
Raw Normal View History

TARGETNAME = inverter
2021-12-02 20:57:19 +00:00
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 =
2021-12-02 20:57:19 +00:00
SRC = $(wildcard src/*.c)
TEST_SRC = $(filter-out src/main.c, $(SRC) $(wildcard test/*.c))
2021-12-02 20:57:19 +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)
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)*
rm -fr $(TEST_BUILDFOLDER)*