From 821c27c6a995dac21fe7021fd9672e7d63cb41fd Mon Sep 17 00:00:00 2001 From: Divlo Date: Sat, 7 Jan 2023 18:57:14 +0100 Subject: [PATCH] chore: minor improvements --- Doxyfile | 2 +- Makefile | 16 ++++++++++++---- README.md | 9 ++++++++- libcproject.h | 1 + 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Doxyfile b/Doxyfile index 65fbfda..4ea2536 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,6 +1,6 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = libcproject -PROJECT_BRIEF = "C static library easier to use than $(libc) (C standard library)." +PROJECT_BRIEF = "C static library easier to use than libc (C standard library)." OUTPUT_DIRECTORY = documentation OUTPUT_LANGUAGE = English OPTIMIZE_OUTPUT_FOR_C = YES diff --git a/Makefile b/Makefile index e1a5c9c..b68297c 100644 --- a/Makefile +++ b/Makefile @@ -12,14 +12,22 @@ MAIN_EXECUTABLE = bin/main.exe SET_VERSION_EXECUTABLE = bin/set_version.exe TEST_EXECUTABLE = bin/test.exe -build/%.o: %.c - mkdir --parents ./build/lib ./build/test - ${CC} ${CC_FLAGS} -c $< -o $@ - ${LIB}: $(addprefix build/, ${LIB_OBJECTS}) rm --force ${LIB} ar -rcs ${LIB} $(addprefix build/, ${LIB_OBJECTS}) +build/lib: + mkdir --parents ./build/lib + +build/test: + mkdir --parents ./build/test + +build/lib/%.o: lib/%.c ${HEADER_FILES} | build/lib + ${CC} ${CC_FLAGS} -c $< -o $@ + +build/test/%.o: test/%.c ${HEADER_FILES} | build/test + ${CC} ${CC_FLAGS} -c $< -o $@ + .PHONY: run run: ${LIB} ./main.c mkdir --parents ./bin diff --git a/README.md b/README.md index d4a404a..ac08d76 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,16 @@ nm ./build/libcproject.a # to see the symbols Steps to create a new C project that uses `libcproject`: -### Step 1: Compile `libcproject` +### Step 1: Install and Compile `libcproject` ```sh +# Clone the repository +git clone https://github.com/Divlo/libcproject.git + +# Go to libcproject directory +cd libcproject + +# Compile the library make ``` diff --git a/libcproject.h b/libcproject.h index 9c0a716..c0d3f16 100644 --- a/libcproject.h +++ b/libcproject.h @@ -11,5 +11,6 @@ #include "lib/stack.h" #include "lib/string.h" #include "lib/terminal.h" +#include "version.h" #endif