make:循环Makefile.out< - Makefile依赖项被删除。 13 C

时间:2018-02-16 23:55:28

标签: gcc makefile compilation cross-compiling

我正在尝试编写一个make文件来构建和编译不同的平台(主机和arm板) 当我尝试制作main.o PLATFORM = HOST它给了我

make: Circular sources.mk.out <- sources.mk dependency dropped.
make: Circular Makefile.out <- Makefile dependency dropped.

我实现的makefile

ifeq ($(PLATFORM) ,MSP432)

# Architectures Specific Flags
LINKER_FILE =msp432p401r.lds
CPU = cortex-m4
ARCH = thumb
SPECS = nosys.specs

# Compiler Flags and Defines
CC =arm-none-eabi-gcc
LD = arm-none-eabi-ld
LDFLAGS = -Wl,-Map=$(TARGET).map -T $(LINKER_FILE)
CFLAGS =-march=armv7e-m -mfloat-abi=hard-mfpu=fpv4-sp-d16 -mcpu=$(CPU) -m$(ARCH) --specs=$(SPECS) -Wall -Werror -g -O0 -std=c99

else

# Architectures Specific Flags
# Compiler Flags and Defines
CC=gcc
LDFLAGS = -Wl,-Map=$(TARGET).map
LD = arm-none-eabi-ld
CFLAGS =  -Wall -Werror -g -O0 -std=c99
endif
OBJS = $(SOURCES:.c=.o)

%.o : %.c
    $(CC) -c $< $(CFLAGS) -D$(PLATFORM)  $(INCLUDES) -o $@

$(TARGET).out: $(OBJS)
    $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(CPPFLAGs) -o $@

有人能发现makefile的问题吗?

0 个答案:

没有答案