mirror of
https://github.com/DarkStore-3DS/buildtools.git
synced 2026-07-07 16:59:45 +00:00
Allow including binary files on targets other than 3DS.
This commit is contained in:
@@ -74,7 +74,6 @@ ifeq ($(TARGET),3DS)
|
|||||||
CC := $(DEVKITARM)/bin/arm-none-eabi-gcc
|
CC := $(DEVKITARM)/bin/arm-none-eabi-gcc
|
||||||
CXX := $(DEVKITARM)/bin/arm-none-eabi-g++
|
CXX := $(DEVKITARM)/bin/arm-none-eabi-g++
|
||||||
|
|
||||||
BIN2S := $(DEVKITARM)/bin/bin2s
|
|
||||||
PICASSO := $(DEVKITARM)/bin/picasso
|
PICASSO := $(DEVKITARM)/bin/picasso
|
||||||
SMDHTOOL := $(DEVKITARM)/bin/smdhtool
|
SMDHTOOL := $(DEVKITARM)/bin/smdhtool
|
||||||
_3DSXTOOL := $(DEVKITARM)/bin/3dsxtool
|
_3DSXTOOL := $(DEVKITARM)/bin/3dsxtool
|
||||||
@@ -179,31 +178,28 @@ runhw: $(OUTPUT_FILES) $(OUTPUT_ZIP_FILE)
|
|||||||
@$(_3DSLINK) --address $(REMOTE_IP) $(OUTPUT_DIR)/3ds/$(STRIPPED_NAME)/$(STRIPPED_NAME).3dsx
|
@$(_3DSLINK) --address $(REMOTE_IP) $(OUTPUT_DIR)/3ds/$(STRIPPED_NAME)/$(STRIPPED_NAME).3dsx
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(BUILD_DIR)/%.bin.o: %.bin
|
$(BUILD_DIR)/%.shbin.o: $(BUILD_DIR)/%.shbin.c
|
||||||
@echo $@
|
@echo $@
|
||||||
@$(BIN2S) $< | $(AS) -o $(@)
|
@$(CC) -c $(CC_FLAGS) -MMD -MP -MF $(BUILD_DIR)/$*.d $< -o $@
|
||||||
@echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(BUILD_DIR)/$< | tr . _)`.h
|
|
||||||
@echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(BUILD_DIR)/$< | tr . _)`.h
|
|
||||||
@echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(BUILD_DIR)/$< | tr . _)`.h
|
|
||||||
|
|
||||||
define shader-as
|
define shader-as
|
||||||
$(eval CURBIN := $(patsubst %.shbin.o,%.shbin,$@))
|
$(eval CURBIN := $(patsubst %.shbin.c,%.shbin,$@))
|
||||||
$(PICASSO) -o $(CURBIN) $1
|
$(PICASSO) -o $(CURBIN) $1
|
||||||
$(BIN2S) $(CURBIN) | $(AS) -o $@
|
@cd $(dir $(CURBIN)); \
|
||||||
echo "extern const u8" `(echo $(notdir $(CURBIN)) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h
|
xxd -i $(notdir $(CURBIN)) $(CURDIR)/$@
|
||||||
echo "extern const u8" `(echo $(notdir $(CURBIN)) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h
|
echo "extern const u8" `(echo $(notdir $(CURBIN)) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h
|
||||||
echo "extern const u32" `(echo $(notdir $(CURBIN)) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(CURBIN) | tr . _)`.h
|
echo "extern const u32" `(echo $(notdir $(CURBIN)) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_len";" >> `(echo $(CURBIN) | tr . _)`.h
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(BUILD_DIR)/%.shbin.o: %.v.pica %.g.pica
|
$(BUILD_DIR)/%.shbin.c: %.v.pica %.g.pica
|
||||||
@echo $@
|
@echo $@
|
||||||
@$(call shader-as,$^)
|
@$(call shader-as,$^)
|
||||||
|
|
||||||
$(BUILD_DIR)/%.shbin.o: %.v.pica
|
$(BUILD_DIR)/%.shbin.c: %.v.pica
|
||||||
@echo $@
|
@echo $@
|
||||||
@$(call shader-as,$<)
|
@$(call shader-as,$<)
|
||||||
|
|
||||||
$(BUILD_DIR)/%.shbin.o: %.shlist
|
$(BUILD_DIR)/%.shbin.c: %.shlist
|
||||||
@echo $@
|
@echo $@
|
||||||
@$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)/$(file)))
|
@$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)/$(file)))
|
||||||
|
|
||||||
@@ -289,6 +285,17 @@ $(BUILD_DIR)/%.o: %.S
|
|||||||
@echo $@
|
@echo $@
|
||||||
@$(CC) -c $(CC_FLAGS) -MMD -MP -MF -x assembler-with-cpp $(BUILD_DIR)/$*.d $< -o $@
|
@$(CC) -c $(CC_FLAGS) -MMD -MP -MF -x assembler-with-cpp $(BUILD_DIR)/$*.d $< -o $@
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.bin.o: $(BUILD_DIR)/%.bin.c
|
||||||
|
@echo $@
|
||||||
|
@$(CC) -c $(CC_FLAGS) -MMD -MP -MF $(BUILD_DIR)/$*.d $< -o $@
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.bin.c: %.bin
|
||||||
|
@echo $@
|
||||||
|
@cd $(<D); \
|
||||||
|
xxd -i $(<F) $(CURDIR)/$@
|
||||||
|
@echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(BUILD_DIR)/$< | tr . _)`.h
|
||||||
|
@echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_len";" >> `(echo $(BUILD_DIR)/$< | tr . _)`.h
|
||||||
|
|
||||||
$(foreach file,$(OBJECT_FILES),$(eval $(call createdirrule,$(file))))
|
$(foreach file,$(OBJECT_FILES),$(eval $(call createdirrule,$(file))))
|
||||||
$(foreach file,$(OUTPUT_FILES),$(eval $(call createdirrule,$(file))))
|
$(foreach file,$(OUTPUT_FILES),$(eval $(call createdirrule,$(file))))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user