Add software files
This commit is contained in:
52
sw/.gitignore
vendored
Normal file
52
sw/.gitignore
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
*.obj
|
||||
*.elf
|
||||
|
||||
# Linker output
|
||||
*.ilk
|
||||
*.map
|
||||
*.exp
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.su
|
||||
*.idb
|
||||
*.pdb
|
||||
|
||||
# Kernel Module Compile Results
|
||||
*.mod*
|
||||
*.cmd
|
||||
.tmp_versions/
|
||||
modules.order
|
||||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
27
sw/Makefile
Normal file
27
sw/Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
CC=cl65
|
||||
CFLAGS=-t none
|
||||
LDFLAGS=-C link.ld
|
||||
|
||||
NAME=main
|
||||
|
||||
BIN=$(NAME).bin
|
||||
HEX=$(NAME).hex
|
||||
|
||||
SRCS=$(wildcard *.S) $(wildcard *.c)
|
||||
OBJS+=$(patsubst %.S,%.o,$(filter %S,$(SRCS)))
|
||||
OBJS+=$(patsubst %.c,%.o,$(filter %c,$(SRCS)))
|
||||
|
||||
all: $(BIN)
|
||||
objcopy --input-target=binary --output-target=ihex $(BIN) $(HEX)
|
||||
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(OBJS) $(BIN) $(HEX)
|
||||
|
||||
10
sw/link.ld
Normal file
10
sw/link.ld
Normal file
@@ -0,0 +1,10 @@
|
||||
MEMORY
|
||||
{
|
||||
ROM: start=$8000, size=$8000, type=ro, define=yes, fill=yes, file=%O;
|
||||
}
|
||||
|
||||
SEGMENTS
|
||||
{
|
||||
CODE: load=ROM, type=ro;
|
||||
VECTORS: load=ROM, type=ro, offset=$7ffa;
|
||||
}
|
||||
Reference in New Issue
Block a user