##// END OF EJS Templates
sync
sync

File last commit:

r18:bd9ab647f70a default
r25:b4b05488cb5e default
Show More
stm32f4XX.mk
98 lines | 2.5 KiB | text/x-makefile | MakefileLexer
PROJECTDIR = `pwd`
LIBUC = /opt/libuc2
HEADERSINSTALLPATH = $(LIBUC_INC_DIR_ADS127X)
HEADERS += ads1278.h
SOURCES += ads1278.c
OBJDIR = obj
BINDIR = bin
OBJECTFILES = obj/ads1278.o \
ARCH = stm32f4-arm-none-eabi-gcc
ARCHFOLDER = $(LIBUC)/rules/stm32f4-arm-none-eabi-gcc
TARGET=libads127X
LIBUC_INCLUDES=$(LIBUC_INC_DIR_CORE_CMD) $(LIBUC_INC_DIR_SSP_CMD) $(LIBUC_INC_DIR_UHANDLE_CMD)
LIBUC_LIBRARIES=$(LIBUC_LIBS_DIR_CORE_CMD) $(LIBUC_LIBS_CORE) $(LIBUC_LIBS_DIR_SSP_CMD) $(LIBUC_LIBS_SSP) $(LIBUC_LIBS_DIR_UHANDLE_CMD) $(LIBUC_LIBS_UHANDLE)
TARGETINSTALLPATH=$(LIBUC_LIBS_DIR_ADS127X)
HEADERSINSTALLPATH=$(LIBUC_INC_DIR_ADS127X)
BSP=generic
include $(ARCHFOLDER)/rules.mk
INCLUDES += -I ./
all:lib
@echo Code compiled
.SUFFIXES: .o .c .s
.c.o:
$(LIBUC_CC) -O3 -I $(INCLUDES) -c $(CFLAGS) $< -o $@
.s.o:
$(LIBUC_CC) -O3 -I $(INCLUDES) -c $(CFLAGS) $< -o $@
bin: $(BINDIR)/$(TARGET).elf $(BINDIR)/$(TARGET).bin $(BINDIR)/$(TARGET).hex
@echo "compile bin"
lib: $(BINDIR)/$(TARGET).a
@echo "compile lib"
$(BINDIR)/$(TARGET).a: $(OBJECTFILES)
mkdir -p $(BINDIR)
$(LIBUC_AR) rcs $@ $(OBJECTFILES)
$(OBJDIR):
mkdir -p $(OBJDIR)
%.elf: $(LINKER_SCRIPT) $(OBJECTFILES)
mkdir -p $(BINDIR)
$(LIBUC_CC) $(LIBUC_LDFLAGS) $(LIBUC_CFLAGS) -T $^ -o $@ $(LIBUC_BSP) $(LIBUC_LIBRARIES)
$(LIBUC_OBJDUMP) $(LIBUC_ODFLAGS) $@ > $(@:.elf=.dump)
$(LIBUC_SIZE) $@
%.bin: %.elf $(BIN_LIBS_DEPS)
$(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O binary $< $*.bin
@echo "BIN_LIBS_DEPS"
@echo $(BIN_LIBS_DEPS)
%.hex: %.elf
$(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O ihex $< $*.hex
$(TARGETINSTALLPATH)/$(TARGET).a: $(BINDIR)/$(TARGET).a
mkdir -p $(TARGETINSTALLPATH)
cp $(BINDIR)/$(TARGET).a $(TARGETINSTALLPATH)/$(TARGET).a
libinstall: $(TARGETINSTALLPATH)/$(TARGET).a
@if [ -z $(HEADERSINSTALLPATH) ] ; then echo "No headers to install" ; else mkdir -p $(HEADERSINSTALLPATH) ; fi
@if [ -z "$(HEADERS)" ] ; then echo "No headers to install" ; else echo "cp -f $(HEADERS) $(HEADERSINSTALLPATH)/" ; cp -f $(HEADERS) $(HEADERSINSTALLPATH)/ ; fi
clean:
rm -f *.o *.d *.bin *.hex *.dump *.map *.a *.elf
rm -f $(OBJECTFILES)
rm -f $(BINDIR)/*.bin
rm -f $(BINDIR)/*.hex
rm -f $(BINDIR)/*.dump
rm -f $(BINDIR)/*.map
rm -f $(BINDIR)/*.a
rm -f $(BINDIR)/*.elf
rm -f $(DEVSOURCESND)
rm -f $(ASMDEVSOURCESND)
distclean: clean libclean
rm -f $(TARGETINSTALLPATH)/*.bin
rm -f $(TARGETINSTALLPATH)/*.a
rm -f Makefile
obj/ads1278.o: ads1278.c $(OBJDIR)
$(LIBUC_CC) -O3 -I $(INCLUDES) -c $(CFLAGS) $< -o $@
install:libinstall
libclean:
rm -f $(TARGETINSTALLPATH)/$(TARGET).a