mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-12-24 00:28:34 -07:00
add environment switch for Darwin environments (macos)
This commit is contained in:
parent
2e5802370c
commit
4b4c486d18
2 changed files with 9 additions and 2 deletions
9
Makefile
9
Makefile
|
|
@ -20,6 +20,13 @@ OBJDUMP=$(CROSS_PREFIX)objdump
|
|||
STRIP=$(CROSS_PREFIX)strip
|
||||
CPP=cpp
|
||||
PYTHON=python3
|
||||
ifeq ($(shell uname -s),Darwin)
|
||||
CLANG=clang
|
||||
S=-S
|
||||
else
|
||||
CLANG=cpp
|
||||
S=
|
||||
endif
|
||||
|
||||
# Source files
|
||||
src-y =
|
||||
|
|
@ -66,7 +73,7 @@ $(OUT)%.o: %.c $(OUT)autoconf.h
|
|||
|
||||
$(OUT)%.ld: %.lds.S $(OUT)autoconf.h
|
||||
@echo " Preprocessing $@"
|
||||
$(Q)$(CPP) -I$(OUT) -P -MD -MT $@ $< -o $@
|
||||
$(Q)$(CLANG) -I$(OUT) -P -MD -MT $@ $(S) $< -o $@ ;\
|
||||
|
||||
$(OUT)klipper.elf: $(OBJS_klipper.elf)
|
||||
@echo " Linking $@"
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ $(OUT)stage2.o: lib/pico-sdk/$(MCU)/boot_stage2/$(STAGE2_FILE) $(OUT)autoconf.h
|
|||
# Binary output file rules when using stage2
|
||||
$(OUT)lib/elf2uf2/elf2uf2: lib/elf2uf2/main.cpp
|
||||
@echo " Building $@"
|
||||
$(Q)g++ -g -O -Ilib/pico-sdk $< -o $@
|
||||
$(Q)g++ -g -O -std=c++11 -Ilib/pico-sdk $< -o $@
|
||||
|
||||
$(OUT)klipper.uf2: $(OUT)klipper.elf $(OUT)lib/elf2uf2/elf2uf2
|
||||
@echo " Creating uf2 file $@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue