Adding src so far

This commit is contained in:
2024-08-20 09:35:05 -05:00
parent 6cf298cfea
commit cf9e6955e8
8 changed files with 170 additions and 86 deletions

24
Makefile Normal file
View File

@@ -0,0 +1,24 @@
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)/*