mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 00:38:29 +01:00
The primary data structure backing the little fs was planned to be a little ctz based skip-list for O(logn) lookup and O(1) append. Was initially planning to start with a simple linked list of index blocks, but was having trouble implementing the free-list on top of the structure. Went ahead and adopted the skip-list structure since it may have actually been easier.
50 lines
590 B
Makefile
50 lines
590 B
Makefile
TARGET = lfs
|
|
|
|
CC = gcc
|
|
AR = ar
|
|
SIZE = size
|
|
|
|
SRC += $(wildcard *.c emubd/*.c)
|
|
OBJ := $(SRC:.c=.o)
|
|
DEP := $(SRC:.c=.d)
|
|
ASM := $(SRC:.c=.s)
|
|
|
|
ifdef DEBUG
|
|
CFLAGS += -O0 -g3
|
|
else
|
|
CFLAGS += -Os
|
|
endif
|
|
ifdef WORD
|
|
CFLAGS += -m$(WORD)
|
|
endif
|
|
CFLAGS += -I.
|
|
CFLAGS += -std=c99 -Wall -pedantic
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
asm: $(ASM)
|
|
|
|
size: $(OBJ)
|
|
$(SIZE) -t $^
|
|
|
|
-include $(DEP)
|
|
|
|
$(TARGET): $(OBJ)
|
|
$(CC) $(CFLAGS) $^ $(LFLAGS) -o $@
|
|
|
|
%.a: $(OBJ)
|
|
$(AR) rcs $@ $^
|
|
|
|
%.o: %.c
|
|
$(CC) -c -MMD $(CFLAGS) $< -o $@
|
|
|
|
%.s: %.c
|
|
$(CC) -S $(CFLAGS) $< -o $@
|
|
|
|
clean:
|
|
rm -f $(TARGET)
|
|
rm -f $(OBJ)
|
|
rm -f $(DEP)
|
|
rm -f $(ASM)
|