mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	Now that littlefs has been rebuilt almost from the ground up with the intention to support custom attributes, adding in custom attribute support is relatively easy. The highest bit in the 9-bit type structure indicates that an attribute is a user-specified custom attribute. The user then has a full 8-bits to specify the attribute type. Other than that, custom attributes are treated the same as system-level attributes. Also made some tweaks to custom attributes: - Adopted the opencfg for file-level attributes provided by dpgeorge - Changed setattrs/getattrs to the simpler setattr/getattr functions users will probably be more familiar with. Note that multiple attributes can still be committed atomically with files, though not with directories. - Changed LFS_ATTRS_MAX -> LFS_ATTR_MAX since there's no longer a global limit on the sum of attribute sizes, which was rather confusing. Though they are still limited by what can fit in a metadata-pair.
		
			
				
	
	
		
			65 lines
		
	
	
		
			988 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			65 lines
		
	
	
		
			988 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)
 | |
| 
 | |
| TEST := $(patsubst tests/%.sh,%,$(wildcard tests/test_*))
 | |
| 
 | |
| SHELL = /bin/bash -o pipefail
 | |
| 
 | |
| ifdef DEBUG
 | |
| override CFLAGS += -O0 -g3
 | |
| else
 | |
| override CFLAGS += -Os
 | |
| endif
 | |
| ifdef WORD
 | |
| override CFLAGS += -m$(WORD)
 | |
| endif
 | |
| override CFLAGS += -I.
 | |
| override CFLAGS += -std=c99 -Wall -pedantic
 | |
| 
 | |
| 
 | |
| all: $(TARGET)
 | |
| 
 | |
| asm: $(ASM)
 | |
| 
 | |
| size: $(OBJ)
 | |
| 	$(SIZE) -t $^
 | |
| 
 | |
| .SUFFIXES:
 | |
| test: test_format test_dirs test_files test_seek test_truncate \
 | |
| 	test_entries test_interspersed test_alloc test_paths test_attrs \
 | |
| 	test_move test_orphan test_corrupt
 | |
| test_%: tests/test_%.sh
 | |
| ifdef QUIET
 | |
| 	@./$< | sed -n '/^[-=]/p'
 | |
| else
 | |
| 	./$<
 | |
| endif
 | |
| 
 | |
| -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)
 |