Initial implementation of logging library
Signed-off-by: Aidan Hahn <aidan@aidanis.online>
This commit is contained in:
commit
32cea23421
6 changed files with 998 additions and 0 deletions
35
Makefile
Normal file
35
Makefile
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
CC ?= gcc
|
||||
CFLAGS = -fPIC -Wall -Wextra -O2 -c
|
||||
LDFLAGS = -shared
|
||||
BUILD_DIR ?= $(shell pwd)/build
|
||||
TARGET_DIR ?= $(shell pwd)/target
|
||||
|
||||
ifdef ALOG_HIJACK_PRINTF
|
||||
CFLAGS += -DALOG_HIJACK_PRINTF
|
||||
endif
|
||||
|
||||
ifdef ALOG_DEBUG
|
||||
CFLAGS += -g
|
||||
endif
|
||||
|
||||
OBJ = $(BUILD_DIR)/alog.o
|
||||
LIB = $(TARGET_DIR)/alog.so
|
||||
|
||||
.PHONY: so
|
||||
so: $(if $(shell stat $(LIB)), clean) $(LIB)
|
||||
|
||||
$(LIB): $(TARGET_DIR) $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(LIB) $(OBJ)
|
||||
|
||||
$(OBJ): $(BUILD_DIR)
|
||||
$(CC) $(CFLAGS) alog.c -o $(OBJ)
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir $(BUILD_DIR)
|
||||
|
||||
$(TARGET_DIR):
|
||||
mkdir $(TARGET_DIR)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm $(LIB) $(OBJ)
|
||||
Loading…
Add table
Add a link
Reference in a new issue