|
ALT_DEVICE_FAMILY ?= soc_cv_av
SOCEDS_ROOT ?= $(SOCEDS_DEST_ROOT)
HWLIBS_ROOT = $(SOCEDS_ROOT)/ip/altera/hps/altera_hps/hwlib
HWLIBS_SRC := alt_interrupt.c alt_generalpurpose_io.c alt_globaltmr.c alt_timers.c alt_watchdog.c alt_clock_manager.c
EXAMPLE_SRC := gpio_demo.c
C_SRC := $(EXAMPLE_SRC) $(HWLIBS_SRC)
LINKER_SCRIPT := cycloneV-dk-ram-hosted.ld
MULTILIBFLAGS := -mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=neon
CFLAGS := -g -O0 -Wall -Werror -std=c99 $(MULTILIBFLAGS) -I$(HWLIBS_ROOT)/include
LDFLAGS := -T$(LINKER_SCRIPT) $(MULTILIBFLAGS)
CROSS_COMPILE := arm-altera-eabi-
CC := $(CROSS_COMPILE)gcc
LD := $(CROSS_COMPILE)g++
NM := $(CROSS_COMPILE)nm
OD := $(CROSS_COMPILE)objdump
OC := $(CROSS_COMPILE)objcopy
RM := rm -rf
CP := cp -f
ELF ?= $(basename $(firstword $(C_SRC))).axf
SPL := u-boot-spl.axf
OBJ := $(patsubst %.c,%.o,$(C_SRC))
.PHONY: all
all: $(ELF) $(SPL)
.PHONY: clean
clean:
$(RM) $(ELF) $(SPL) $(OBJ) *.objdump *.map $(HWLIBS_SRC)
#define SET_HWLIBS_DEPENDENCIES
#$(1): $(2)
# $(CP) $(2) $(1)
#endef
#ALL_HWLIBS_SRC = $(wildcard $(HWLIBS_ROOT)/src/hwmgr/*.c) $(wildcard $(HWLIBS_ROOT)/src/hwmgr/$(ALT_DEVICE_FAMILY)/*.c)
#$(foreach file,$(ALL_HWLIBS_SRC),$(eval $(call SET_HWLIBS_DEPENDENCIES,$(notdir $(file)),$(file))))
%.c: $(HWLIBS_ROOT)/src/hwmgr/%.c
$(CP) $< $@
$(SPL): C:\Lab\de1_soc_GHRD\software\preloader-led/uboot-socfpga/spl/u-boot-spl
$(CP) $< $@
$(OD) -d $@ > $@.objdump
$(OBJ): %.o: %.c Makefile
$(CC) $(CFLAGS) -c $< -o $@
$(ELF): $(OBJ)
$(LD) $(LDFLAGS) $(OBJ) -o $@
$(OD) -d $@ > $@.objdump
$(NM) $@ > $@.map
以上是在线调试makefile,加了 $(OD) -d $@ > $@.objdump 、$(NM) $@ > $@.map两句就会报错make: *** [gpio_demo.axf] Error 254。想请教下这两句是干嘛用的?以及怎么修改才能不报错?
|
|