c-rss/Makefile

25 lines
762 B
Makefile
Raw Normal View History

2024-08-20 14:35:05 +00:00
CFLAGS = -std=c17
CPPFLAGS = -std=c++17
APPS_DIR = ./apps
TARGETS_DIR = ./targets
OBJECTS_DIR = ./build
LIBS_DIR = ./src
INCLUDES = -I ./include
TESTS_DIR = ./tests
VPATH = $(TARGETS_DIR) $(OBJECTS_DIR) $(APPS_DIR) $(LIBS_DIR) $(TESTS_DIR)
main: main.c requests.o
cc $(CFLAGS) $(INCLUDES) -lcurl $(APPS_DIR)/main.c $(LIBS_DIR)/requests.c -o $(TARGETS_DIR)/main
requests.o: requests.c
$(CC) $(CFLAGS) $(INCLUDES) -c $(LIBS_DIR)/requests.c -o $(OBJECTS_DIR)/requests.o
test: test_requests
$(TARGETS_DIR)/test_requests
test_requests: test_requests.cpp requests.o
$(CXX) $(CPPFLAGS) $(INCLUDES) -lcurl -lgtest -lgtest_main $(TESTS_DIR)/test_requests.cpp $(OBJECTS_DIR)/requests.o -o $(TARGETS_DIR)/test_requests
clean:
rm $(TARGETS_DIR)/* $(OBJECTS_DIR)/*