<commit_before>#
# Author: Mikeqin <<EMAIL>>
#
# This is free and unencumbered software released into the public domain.
# For details see the UNLICENSE file at the root of the source tree.
#

SW_NAME = avalon_nano

# RELEASE / DEBUG
SW_VERSION = RELEASE

DATE:=$(shell date +%Y-%m-%d)
OS:=$(shell uname -s)

include make/platform_lpc11u14.mk

INCLUDES = -I./code/inc -I./nxplib/lpc_chip_11uxx_lib/inc -I./nxplib/nxp_lpcxpresso_11u14_board_lib/inc -I./nxplib/lpc_chip_11uxx_lib/inc/usbd
SRCS = $(wildcard ./code/src/*.c)
OBJS=$(patsubst %.c,%.o,$(SRCS))
LDCFLAGS += -nostdlib -Xlinker -Map=$(SW_NAME).map -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T $(SW_NAME).ld
LDLIBS += -lnxp_lpcxpresso_11u14_board_lib -llpc_chip_11uxx_lib -lusbd_11uxx_lib
LIBPATH += -L./nxplib/lpc_chip_11uxx_lib/libs -L./nxplib/nxp_lpcxpresso_11u14_board_lib/libs

all: $(SW_NAME).axf
	mkdir -p bin/$(DATE)
	cp $^ bin/$(DATE)
ifeq "$(OS)" "Darwin"
	cd bin/$(DATE) && md5 $^ > md5sums
else
        # linux
	cd bin/$(DATE) && md5sum -b $^ > md5sums
endif
	@echo "Ver:$(SW_VERSION) generate finsh"

$(SW_NAME).axf:	$(OBJS) lpc_chip_11uxx_lib nxp_lpcxpresso_11u14_board_lib
	$(CC) $(LDCFLAGS) $(LIBPATH) $(OBJS) $(LDLIBS) -o $(SW_NAME).axf

lpc_chip_11uxx_lib:
	make -C nxplib/lpc_chip_11uxx_lib

nxp_lpcxpresso_11u14_board_lib:
	make -C nxplib/nxp_lpcxpresso_11u14_board_lib

%.o : %.c
	$(CC) -c -o $@ $< $(PLATFORM_CFLAGS) $(INCLUDES)

clean:
	@make -C nxplib/lpc_chip_11uxx_lib clean
	@make -C nxplib/nxp_lpcxpresso_11u14_board_lib clean
	-@rm -f $(OBJS) $(SW_NAME).axf $(SW_NAME).map
	@echo "Clean finish"<commit_msg>Firmware: Add a rule to reflash the firmware<commit_after>#
# Author: Mikeqin <<EMAIL>>
#
# This is free and unencumbered software released into the public domain.
# For details see the UNLICENSE file at the root of the source tree.
#

SW_NAME = avalon_nano

# RELEASE / DEBUG
SW_VERSION = RELEASE

DATE:=$(shell date +%Y-%m-%d)
OS:=$(shell uname -s)

include make/platform_lpc11u14.mk

INCLUDES = -I./code/inc -I./nxplib/lpc_chip_11uxx_lib/inc -I./nxplib/nxp_lpcxpresso_11u14_board_lib/inc -I./nxplib/lpc_chip_11uxx_lib/inc/usbd
SRCS = $(wildcard ./code/src/*.c)
OBJS=$(patsubst %.c,%.o,$(SRCS))
LDCFLAGS += -nostdlib -Xlinker -Map=$(SW_NAME).map -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T $(SW_NAME).ld
LDLIBS += -lnxp_lpcxpresso_11u14_board_lib -llpc_chip_11uxx_lib -lusbd_11uxx_lib
LIBPATH += -L./nxplib/lpc_chip_11uxx_lib/libs -L./nxplib/nxp_lpcxpresso_11u14_board_lib/libs

all: $(SW_NAME).axf
	mkdir -p bin/$(DATE)
	cp $^ bin/$(DATE)
ifeq "$(OS)" "Darwin"
	cd bin/$(DATE) && md5 $^ > md5sums
else
        # linux
	cd bin/$(DATE) && md5sum -b $^ > md5sums
endif
	@echo "Ver:$(SW_VERSION) generate finsh"

$(SW_NAME).axf:	$(OBJS) lpc_chip_11uxx_lib nxp_lpcxpresso_11u14_board_lib
	$(CC) $(LDCFLAGS) $(LIBPATH) $(OBJS) $(LDLIBS) -o $(SW_NAME).axf

lpc_chip_11uxx_lib:
	make -C nxplib/lpc_chip_11uxx_lib

nxp_lpcxpresso_11u14_board_lib:
	make -C nxplib/nxp_lpcxpresso_11u14_board_lib

%.o : %.c
	$(CC) -c -o $@ $< $(PLATFORM_CFLAGS) $(INCLUDES)

reflash: $(SW_NAME).axf
	@crt_emu_cm_redlink -flash-load-exec $(SW_NAME).axf -g -2  -vendor=NXP -pLPC11U14/201 -flash-driver=LPC11_12_13_32K_4K.cfx

clean:
	@make -C nxplib/lpc_chip_11uxx_lib clean
	@make -C nxplib/nxp_lpcxpresso_11u14_board_lib clean
	-@rm -f $(OBJS) $(SW_NAME).axf $(SW_NAME).map
	@echo "Clean finish"
{'fraction_non_alphanumeric': 0.15599051008303677, 'fraction_numerical': 0.03766310794780545, 'mean_word_length': 4.659395973154362, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4777839', 'n_tokens_mistral': 1670, 'n_tokens_neox': 1570, 'n_words': 292}