Skip to content

Commit 192770f

Browse files
committed
Initial commit
0 parents commit 192770f

File tree

5 files changed

+1110
-0
lines changed

5 files changed

+1110
-0
lines changed

Makefile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
TARGET = lfs.js
2+
3+
CC = emcc
4+
AR = ar
5+
SIZE = size
6+
7+
SRC += $(wildcard *.c littlefs/*.c)
8+
OBJ := $(SRC:.c=.o)
9+
DEP := $(SRC:.c=.d)
10+
ASM := $(SRC:.c=.s)
11+
12+
TEST := $(patsubst tests/%.sh,%,$(wildcard tests/test_*))
13+
14+
ifdef DEBUG
15+
CFLAGS += -O0 -g3
16+
else
17+
CFLAGS += -Os
18+
endif
19+
ifdef WORD
20+
CFLAGS += -m$(WORD)
21+
endif
22+
CFLAGS += -I. -Ilittlefs
23+
CFLAGS += -std=c99 -Wall -pedantic
24+
25+
CFLAGS += -s RESERVED_FUNCTION_POINTERS=20
26+
27+
28+
all: $(TARGET)
29+
30+
asm: $(ASM)
31+
32+
size: $(OBJ)
33+
$(SIZE) -t $^
34+
35+
.SUFFIXES:
36+
test: test_format test_dirs test_files test_seek test_parallel \
37+
test_alloc test_paths test_orphan test_move test_corrupt
38+
test_%: tests/test_%.sh
39+
./$<
40+
41+
-include $(DEP)
42+
43+
$(TARGET): $(OBJ)
44+
$(CC) $(CFLAGS) $^ $(LFLAGS) -o $@
45+
46+
%.a: $(OBJ)
47+
$(AR) rcs $@ $^
48+
49+
%.o: %.c
50+
$(CC) -c -MMD $(CFLAGS) $< -o $@
51+
52+
%.s: %.c
53+
$(CC) -S $(CFLAGS) $< -o $@
54+
55+
clean:
56+
rm -f $(TARGET)
57+
rm -f $(OBJ)
58+
rm -f $(DEP)
59+
rm -f $(ASM)

0 commit comments

Comments
 (0)