mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #2382 from openmv/clang_imlib
misc: Add support for building specific imlib files with clang.
This commit is contained in:
commit
b56df8dc1f
@ -17,6 +17,7 @@ endif
|
||||
|
||||
# Commands
|
||||
CC = $(Q)arm-none-eabi-gcc
|
||||
CLANG = $(Q)clang
|
||||
CXX = $(Q)arm-none-eabi-g++
|
||||
AS = $(Q)arm-none-eabi-as
|
||||
LD = $(Q)arm-none-eabi-ld
|
||||
|
||||
@ -109,6 +109,10 @@ SRCS += $(addprefix imlib/, \
|
||||
SRCS += $(wildcard ports/$(PORT)/*.c)
|
||||
|
||||
OBJS = $(addprefix $(BUILD)/, $(SRCS:.c=.o))
|
||||
ifeq ($(USE_CLANG),1)
|
||||
CLANG_OBJS = $(BUILD)/imlib/bayer.o
|
||||
endif
|
||||
|
||||
OBJ_DIRS = $(sort $(dir $(OBJS)))
|
||||
|
||||
all: | $(OBJ_DIRS) $(OBJS)
|
||||
@ -123,6 +127,11 @@ $(BUILD)/%.o : %.s
|
||||
$(ECHO) "AS $<"
|
||||
$(AS) $(AFLAGS) $< -o $@
|
||||
|
||||
# Rule for compiling with clang
|
||||
$(CLANG_OBJS): $(BUILD)/%.o : %.c
|
||||
$(ECHO) "CL $<"
|
||||
$(CLANG) $(CLANG_FLAGS) -c -o $@ $<
|
||||
|
||||
$(BUILD)/imlib/fmath.o: override CFLAGS += -fno-strict-aliasing
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
# Export Commands
|
||||
export Q
|
||||
export CC
|
||||
export CLANG
|
||||
export CXX
|
||||
export AS
|
||||
export LD
|
||||
|
||||
Loading…
Reference in New Issue
Block a user