migrating
parent
e91fc41591
commit
519c761f7a
@ -0,0 +1,6 @@
|
||||
((c-mode . ((lsp-clients-clangd-args . ("--compile-commands-dir=build/"
|
||||
"--pch-storage=memory"
|
||||
"--background-index"
|
||||
"-j=4"
|
||||
))
|
||||
)))
|
@ -1,41 +0,0 @@
|
||||
CC=gcc
|
||||
CFLAGS=-std=c99 -Wall -Wextra
|
||||
|
||||
|
||||
|
||||
BIN=./bin
|
||||
SRC=./src
|
||||
INC=./inc
|
||||
TEST=./test
|
||||
EXAMPLE_DIR=./example
|
||||
TESTER_OBJS=$(BIN)/PCircularBuffer.o $(BIN)/test.o
|
||||
EXAMPLE_OBJS=$(BIN)/PCircularBuffer.o $(BIN)/simple_circular_buffer_example.o
|
||||
|
||||
TESTER=$(BIN)/tester
|
||||
EXAMPLE=$(BIN)/simple_circular_buffer_example
|
||||
|
||||
$(TESTER): $(TESTER_OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $(TESTER_OBJS)
|
||||
|
||||
$(EXAMPLE): $(EXAMPLE_OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $(EXAMPLE_OBJS)
|
||||
|
||||
$(BIN)/PCircularBuffer.o: $(SRC)/PCircularBuffer.c $(INC)/PCircularBuffer.h
|
||||
$(CC) -c $(CFLAGS) -I$(INC) $(SRC)/PCircularBuffer.c -o $(BIN)/PCircularBuffer.o
|
||||
|
||||
$(BIN)/test.o: $(TEST)/test.c
|
||||
$(CC) -c $(CFLAGS) -I$(INC) $(TEST)/test.c -o $(BIN)/test.o
|
||||
|
||||
$(BIN)/simple_circular_buffer_example.o: $(EXAMPLE_DIR)/simple_circular_buffer_example.c
|
||||
$(CC) -c $(CFLAGS) -I$(INC) $(EXAMPLE_DIR)/simple_circular_buffer_example.c -o $(BIN)/simple_circular_buffer_example.o
|
||||
|
||||
all: $(TESTER) $(EXAMPLE)
|
||||
|
||||
clean:
|
||||
rm -rf $(BIN)/*
|
||||
|
||||
test: $(TESTER)
|
||||
$(TESTER)
|
||||
|
||||
example: $(EXAMPLE)
|
||||
$(EXAMPLE)
|
@ -0,0 +1,54 @@
|
||||
PRJNAME=pcbuffer
|
||||
PRJOUT=lib$(PRJNAME).a
|
||||
|
||||
TESTSOUT=$(PRJNAME)_tests
|
||||
EXAMPLESOUT=$(PRJNAME)_example
|
||||
CC=gcc
|
||||
SIZE=size
|
||||
MK_DIR=mkdir -p
|
||||
|
||||
CFLAGS=\
|
||||
-Wall \
|
||||
-DDEBUG \
|
||||
-std=gnu11 \
|
||||
-ffunctions-sections \
|
||||
-O3 \
|
||||
-g3
|
||||
|
||||
|
||||
ARFLAGS=\
|
||||
|
||||
# Core Stuff
|
||||
CORE_SUB_DIRS=src
|
||||
CORE_INC_DIRS=\
|
||||
-I../cfg \
|
||||
-I../inc
|
||||
|
||||
# Tests
|
||||
TESTS_SUB_DIRS=\
|
||||
test/src
|
||||
|
||||
TESTS_INC_DIRS=\
|
||||
-I../tests/inc \
|
||||
-I../test/cfg
|
||||
|
||||
# Examples
|
||||
EXAMPLES_SUB_DIRS=\
|
||||
EXAMPLES_INC_DIRS=\
|
||||
|
||||
.PHONY: all tests examples clean
|
||||
|
||||
all: $(CORE_SUB_DIRS) $(PRJOUT)
|
||||
tests: all $(TESTS_SUB_DIRS) $(TESTSOUT)
|
||||
examples: all $(EXAMPLES_SUB_DIRS) $(EXAMPLESOUT)
|
||||
|
||||
$(PRJOUT): $(CORE_OBJS)
|
||||
$(AR) $(CORE_INC_DIRS) $(CFLAGS) $(ARFLAGS) $@ $<
|
||||
|
||||
$(TESTSOUT): $(TEST_OBJS)
|
||||
$(CC) $(CFLAGS) -o $< $(TEST_OBJS)
|
||||
|
||||
$(EXAMPLESOUT)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue