<commit_before>## AAUSAT3 libcsp makefile

## Configuration
ifndef ARCH
ARCH = posix
endif

ifndef TOOLCHAIN
TOOLCHAIN = 
endif

TARGET = libcsp.a
ifndef OUTDIR
OUTDIR = .
endif
MCU = at90can128
CC = $(TOOLCHAIN)gcc
AR = $(TOOLCHAIN)ar
SZ = $(TOOLCHAIN)size

## Options common to compile, link and assembly rules

ifeq ($(TOOLCHAIN),avr-)
COMMON +=-mmcu=$(MCU)
else 
COMMON =
endif

## Compile options common for all C compilation units.
CFLAGS =$(COMMON)
ifeq ($(TOOLCHAIN),avr-)
CFLAGS += -fshort-enums
else ifeq ($(TOOLCHAIN),bfin-linux-uclibc-)
CFLAGS += -D_GNU_SOURCE
else ifeq ($(TOOLCHAIN),)
CFLAGS += -fPIC
endif
CFLAGS += -Wall -Werror -std=gnu99 -Os

## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2

## Archiver flags
ARFLAGS = -rcu

## Include Directories
INCLUDES = -I./include
INCLUDES += -I../libavr/include/
INCLUDES += -I../libfreertos/include/

## Objects that must be built in order to archive
SOURCES += src/csp_buffer.c
SOURCES += src/csp_conn.c
SOURCES += src/csp_io.c
SOURCES += src/csp_route.c
SOURCES += src/csp_port.c
SOURCES += src/csp_services.c
SOURCES += src/csp_endian.c
SOURCES += src/csp_service_handler.c
SOURCES += src/arch/$(ARCH)/csp_malloc.c
SOURCES += src/arch/$(ARCH)/csp_queue.c
SOURCES += src/arch/$(ARCH)/csp_semaphore.c
SOURCES += src/arch/$(ARCH)/csp_time.c
SOURCES += src/arch/$(ARCH)/csp_thread.c
SOURCES += src/interfaces/csp_if_lo.c
SOURCES += src/interfaces/csp_if_can.c
SOURCES += src/transport/csp_rdp.c
SOURCES += src/transport/csp_udp.c
SOURCES += src/crypto/csp_sha1.c
SOURCES += src/crypto/csp_hmac.c
SOURCES += src/crypto/csp_xtea.c

ifeq ($(TOOLCHAIN),)
SOURCES += src/csp_debug.c
SOURCES += src/interfaces/can/can_socketcan.c
endif

ifeq ($(TOOLCHAIN),avr-)
SOURCES += src/interfaces/can/can_at90can128.c
endif

## POSIX archs requires pthread_queue
ifeq ($(ARCH),posix)
SOURCES += src/arch/$(ARCH)/pthread_queue.c
endif

OBJECTS=$(SOURCES:.c=.o)

# Define PHONY targets
.PHONY: all clean size

## Default target
all: $(SOURCES) $(TARGET) size

## Compile
.c.o:
	$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@

## Archive to create static lib
$(TARGET): $(OBJECTS)
	$(AR) $(ARFLAGS) $(OUTDIR)/$(TARGET) $(OBJECTS) 

size:
	$(SZ) -t $(OUTDIR)/$(TARGET)

## Clean target
clean:
	-rm -rf $(OBJECTS) $(OUTDIR)/$(TARGET)<commit_msg>Added csp_crc32.c to the Makefile, added AT91SAM7A3 check in Makefile to include driver<commit_after>## AAUSAT3 libcsp makefile

## Configuration
ifndef ARCH
ARCH = posix
endif

ifndef TOOLCHAIN
TOOLCHAIN = 
endif

TARGET = libcsp.a
ifndef OUTDIR
OUTDIR = .
endif
MCU = at90can128
CC = $(TOOLCHAIN)gcc
AR = $(TOOLCHAIN)ar
SZ = $(TOOLCHAIN)size

## Options common to compile, link and assembly rules

ifeq ($(TOOLCHAIN),avr-)
COMMON +=-mmcu=$(MCU)
else 
COMMON =
endif

## Compile options common for all C compilation units.
CFLAGS =$(COMMON)
ifeq ($(TOOLCHAIN),avr-)
CFLAGS += -fshort-enums
else ifeq ($(TOOLCHAIN),bfin-linux-uclibc-)
CFLAGS += -D_GNU_SOURCE
else ifeq ($(TOOLCHAIN),)
CFLAGS += -fPIC
endif
CFLAGS += -Wall -Werror -std=gnu99 -Os

## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2

## Archiver flags
ARFLAGS = -rcu

## Include Directories
INCLUDES = -I./include
INCLUDES += -I../libavr/include/
INCLUDES += -I../libfreertos/include/

## Objects that must be built in order to archive
SOURCES += src/csp_buffer.c
SOURCES += src/csp_conn.c
SOURCES += src/csp_io.c
SOURCES += src/csp_route.c
SOURCES += src/csp_port.c
SOURCES += src/csp_services.c
SOURCES += src/csp_endian.c
SOURCES += src/csp_service_handler.c
SOURCES += src/csp_crc32.c
SOURCES += src/arch/$(ARCH)/csp_malloc.c
SOURCES += src/arch/$(ARCH)/csp_queue.c
SOURCES += src/arch/$(ARCH)/csp_semaphore.c
SOURCES += src/arch/$(ARCH)/csp_time.c
SOURCES += src/arch/$(ARCH)/csp_thread.c
SOURCES += src/interfaces/csp_if_lo.c
SOURCES += src/interfaces/csp_if_can.c
SOURCES += src/transport/csp_rdp.c
SOURCES += src/transport/csp_udp.c
SOURCES += src/crypto/csp_sha1.c
SOURCES += src/crypto/csp_hmac.c
SOURCES += src/crypto/csp_xtea.c

ifeq ($(TOOLCHAIN),)
SOURCES += src/csp_debug.c
SOURCES += src/interfaces/can/can_socketcan.c
endif

ifeq ($(TOOLCHAIN),avr-)
SOURCES += src/interfaces/can/can_at90can128.c
endif

ifeq($(TOOLCHAIN),arm-none-eabi-)
SOURCES += src/csp_debug.c
SOURCES += src/interfaces/can/can_at91sam7a3.c
endif

## POSIX archs requires pthread_queue
ifeq ($(ARCH),posix)
SOURCES += src/arch/$(ARCH)/pthread_queue.c
endif

OBJECTS=$(SOURCES:.c=.o)

# Define PHONY targets
.PHONY: all clean size

## Default target
all: $(SOURCES) $(TARGET) size

## Compile
.c.o:
	$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@

## Archive to create static lib
$(TARGET): $(OBJECTS)
	$(AR) $(ARFLAGS) $(OUTDIR)/$(TARGET) $(OBJECTS) 

size:
	$(SZ) -t $(OUTDIR)/$(TARGET)

## Clean target
clean:
	-rm -rf $(OBJECTS) $(OUTDIR)/$(TARGET)
{'fraction_non_alphanumeric': 0.16272912423625255, 'fraction_numerical': 0.008553971486761711, 'mean_word_length': 4.625429553264605, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7158083', 'n_tokens_mistral': 2158, 'n_tokens_neox': 1944, 'n_words': 437}