common.mk: add binary header rule
This commit is contained in:
parent
5f515a20d4
commit
0c7c2e663a
11
common.mk
11
common.mk
@ -28,6 +28,17 @@ define BUILD_BINARY_O
|
||||
$< $@
|
||||
endef
|
||||
|
||||
as_obj_binary = _binary_$(subst .,_,$(subst /,_,$(basename $(1))))
|
||||
|
||||
define BUILD_BINARY_H
|
||||
@echo $@
|
||||
@echo '#pragma once' > $@
|
||||
@echo '#include <stdint.h>' >> $@
|
||||
@echo 'extern uint32_t $(call as_obj_binary,$@)_start __asm("$(call as_obj_binary,$@)_start");' >> $@
|
||||
@echo 'extern uint32_t $(call as_obj_binary,$@)_end __asm("$(call as_obj_binary,$@)_end");' >> $@
|
||||
@echo 'extern uint32_t $(call as_obj_binary,$@)_size __asm("$(call as_obj_binary,$@)_size");' >> $@
|
||||
endef
|
||||
|
||||
%.o: %.s
|
||||
$(AS) $(AARCH) $(AFLAGS) $(DEBUG) $< -o $@
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user