inv-sw-linux/Makefile

31 lines
706 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)
2024-01-16 15:28:21 +00:00
INC = -Isrc/include -I/usr/include
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)
2024-01-16 15:28:21 +00:00
cc -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(INC) -lm
$(TEST_TARGETNAME): $(TEST_TARGET)
$(TEST_TARGET): $(TEST_SRC)
mkdir -p $(TEST_BUILDFOLDER)
2024-01-16 15:28:21 +00:00
cc -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(INC) -lm -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)*