Add some basic fat32 code
This commit is contained in:
48
sw/test_code/fs_test/Makefile
Normal file
48
sw/test_code/fs_test/Makefile
Normal file
@@ -0,0 +1,48 @@
|
||||
CC=../../cc65/bin/cl65
|
||||
LD=../../cc65/bin/cl65
|
||||
SIM=../../cc65/bin/sim65
|
||||
CFLAGS=-T -t sim65c02 -I.
|
||||
LDFLAGS=-m $(NAME).map
|
||||
|
||||
NAME=fs_test
|
||||
|
||||
BIN=$(NAME).bin
|
||||
|
||||
FS=$(REPO_TOP)/sw/script/fs.fat
|
||||
|
||||
LISTS=lists
|
||||
|
||||
EXT_SRCS=$(REPO_TOP)/sw/kernel/filesystems/fat32.s
|
||||
|
||||
SRCS=$(wildcard *.s) $(wildcard *.c)
|
||||
SRCS+=$(wildcard **/*.s) $(wildcard **/*.c)
|
||||
OBJS+=$(patsubst %.s,%.o,$(filter %s,$(SRCS)))
|
||||
OBJS+=$(patsubst %.c,%.o,$(filter %c,$(SRCS)))
|
||||
|
||||
run: all
|
||||
$(SIM) $(BIN)
|
||||
|
||||
all: fs.fat fat32.s $(BIN)
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
|
||||
|
||||
%.o: %.c $(LISTS)
|
||||
$(CC) $(CFLAGS) -l $(LISTS)/$<.list -c $< -o $@
|
||||
|
||||
%.o: %.s $(LISTS)
|
||||
$(CC) $(CFLAGS) -l $(LISTS)/$<.list -c $< -o $@
|
||||
|
||||
fat32.s: $(EXT_SRCS)
|
||||
cp $^ .
|
||||
|
||||
fs.fat: $(FS)
|
||||
cp $^ .
|
||||
|
||||
$(LISTS):
|
||||
mkdir -p $(addprefix $(LISTS)/,$(sort $(dir $(SRCS))))
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(OBJS) $(BIN) $(HEX) $(LISTS) $(NAME).map fat32.s
|
||||
|
||||
Reference in New Issue
Block a user