mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			57 lines
		
	
	
		
			705 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			705 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_*))
 | |
| 
 | |
| 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 $^
 | |
| 
 | |
| .SUFFIXES:
 | |
| test: $(TEST)
 | |
| test_%: tests/test_%.sh
 | |
| 	./$<
 | |
| 
 | |
| -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)
 |