diff options
| author | spl3g <spleefer6@yandex.ru> | 2025-03-22 21:41:16 +0300 |
|---|---|---|
| committer | spl3g <spleefer6@yandex.ru> | 2025-03-22 21:41:16 +0300 |
| commit | 62454373db4cd2add82ded0cf7b21f7d69ade597 (patch) | |
| tree | 1627133fe4567e9a3abb707af5e7289353410d5f /Makefile | |
| parent | ef5f52fb739c9f0d71c579f08363ef0dfd5c227d (diff) | |
Reorganize the lib
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -1,2 +1,26 @@ -main: main.c lib - cc -Wall -Wextra -ggdb -o main main.c lib/arena_strings.c lib/http.c lib/arena.c lib/const_strings.c +CC = gcc +AR = ar +CFLAGS = -Wall -Wextra -fPIC -Iinclude/ + +LIBNAME = chttp +SOURCES = $(wildcard src/*.c) +OBJECTS = $(SOURCES:.c=.o) + +all: static + +static: $(OBJECTS) + $(AR) rcs $(LIBNAME).a $(OBJECTS) + +shared: $(OBJECTS) + $(CC) -shared -o $(LIBNAME).so $(OBJECTS) + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +install: all + install -d /usr/local/include/yourlib/ + install include/yourlib/*.h /usr/local/include/yourlib/ + install $(LIBNAME) /usr/local/lib/ + +clean: + rm -f src/*.o *.a *.so |
