SCPI parser and status register model implementation (device side) written in C
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
scpi_parser/Makefile

55 lines
1.5 KiB

###############################################################################
# Makefile to build a library for ARM CortexM3
FP_FLAGS = -mfloat-abi=hard -mfpu=fpv4-sp-d16
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 $(FP_FLAGS)
9 years ago
INCL_DIR = include
SRC_DIR = source
9 years ago
LIBNAME = arm_cortexM4_scpi
9 years ago
OBJS = $(SRC_DIR)/scpi_parser.o
OBJS += $(SRC_DIR)/scpi_regs.o
OBJS += $(SRC_DIR)/scpi_errors.o
OBJS += $(SRC_DIR)/scpi_builtins.o
9 years ago
JUNK = *.o *.d *.elf *.bin *.hex *.srec *.list *.map *.dis *.disasm *.a
###############################################################################
PREFIX ?= arm-none-eabi
CC := $(PREFIX)-gcc
AR := $(PREFIX)-ar
###############################################################################
CFLAGS += -Os -ggdb -std=gnu99 -Wfatal-errors
CFLAGS += -Wall -Wextra -Wshadow
CFLAGS += -Wwrite-strings -Wold-style-definition -Winline -Wmissing-noreturn -Wstrict-prototypes
CFLAGS += -Wredundant-decls -Wfloat-equal -Wsign-compare
CFLAGS += -fno-common -ffunction-sections -fdata-sections -Wunused-function
CFLAGS += -I$(INCL_DIR)
###############################################################################
all: lib
%.o: %.c
$(Q)$(CC) $(CFLAGS) $(ARCH_FLAGS) -o $(*).o -c $(*).c
lib: lib/lib$(LIBNAME).a
lib/lib$(LIBNAME).a: $(OBJS)
$(Q)$(AR) rcs $@ $(OBJS)
9 years ago
clean:
$(Q)$(RM) $(JUNK)
$(Q)cd source && $(RM) $(JUNK)
$(Q)cd lib && $(RM) $(JUNK)
$(Q)cd example && $(RM) $(JUNK)
.PHONY: clean all lib