Prepare makefile
This commit is contained in:
parent
9fd9da783c
commit
c8b92ecb02
|
@ -7,6 +7,9 @@ include $(AUTO_OVERLAY_DIR)/Overlays.mk
|
||||||
JABY_ENGINE_LIB_DIR = $(JABY_ENGINE_DIR)/lib/PSX-$(BUILD_PROFILE)
|
JABY_ENGINE_LIB_DIR = $(JABY_ENGINE_DIR)/lib/PSX-$(BUILD_PROFILE)
|
||||||
JABY_ENGINE_LIB_NAME = JabyEngine_$(TV_FORMAT)
|
JABY_ENGINE_LIB_NAME = JabyEngine_$(TV_FORMAT)
|
||||||
|
|
||||||
|
#We use this via a flag later
|
||||||
|
OBJS += $(JABY_ENGINE_LIB_DIR)/main_boot.o
|
||||||
|
|
||||||
#Linking rule
|
#Linking rule
|
||||||
$(TARGET).elf: $(OBJS) $(JABY_ENGINE_LIB_DIR)/lib$(JABY_ENGINE_LIB_NAME).a $(AUTO_OVERLAY_DIR)/Overlays.ld
|
$(TARGET).elf: $(OBJS) $(JABY_ENGINE_LIB_DIR)/lib$(JABY_ENGINE_LIB_NAME).a $(AUTO_OVERLAY_DIR)/Overlays.ld
|
||||||
$(LD) -o $(TARGET).elf $(LDFLAGS_all) $(LDFLAGS) $(OBJS) -L$(JABY_ENGINE_LIB_DIR) -l$(JABY_ENGINE_LIB_NAME) $(LIBS)
|
$(LD) -o $(TARGET).elf $(LDFLAGS_all) $(LDFLAGS) $(OBJS) -L$(JABY_ENGINE_LIB_DIR) -l$(JABY_ENGINE_LIB_NAME) $(LIBS)
|
||||||
|
|
|
@ -16,15 +16,26 @@ SRCS += src/syscall_printf.asm
|
||||||
include ../../lib/Makefile
|
include ../../lib/Makefile
|
||||||
LIB_DIR = ../../lib/$(CONFIG_NAME)
|
LIB_DIR = ../../lib/$(CONFIG_NAME)
|
||||||
|
|
||||||
#Linking rule
|
MAIN_BOOT_OBJ = $(filter %/main_boot.o,$(OBJS))
|
||||||
$(TARGET).a: $(OBJS) $(SPLASH_IMAGE)
|
MAIN_LIB_OBJS = $(filter-out $(MAIN_BOOT_OBJ),$(OBJS))
|
||||||
@mkdir -p $(dir $@)
|
|
||||||
$(AR) rcs $(TARGET).a $(OBJS)
|
|
||||||
|
|
||||||
|
#$(info $$var is [${MAIN_BOOT_OBJ}])
|
||||||
|
#$(info $$var2 is [${MAIN_LIB_OBJS}])
|
||||||
|
|
||||||
|
#Linking rule
|
||||||
|
$(TARGET).a: $(MAIN_LIB_OBJS) $(SPLASH_IMAGE)
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(AR) rcs $(TARGET).a $(MAIN_LIB_OBJS)
|
||||||
|
|
||||||
|
#Copy rules
|
||||||
$(LIB_DIR)/$(ARTIFACT).a: $(TARGET).a
|
$(LIB_DIR)/$(ARTIFACT).a: $(TARGET).a
|
||||||
@mkdir -p $(LIB_DIR)
|
@mkdir -p $(LIB_DIR)
|
||||||
cp $(TARGET).a $(LIB_DIR)/$(ARTIFACT).a
|
cp $(TARGET).a $(LIB_DIR)/$(ARTIFACT).a
|
||||||
|
|
||||||
|
$(LIB_DIR)/$(notdir $(MAIN_BOOT_OBJ)): $(MAIN_BOOT_OBJ)
|
||||||
|
@mkdir -p $(LIB_DIR)
|
||||||
|
cp $(MAIN_BOOT_OBJ) $(LIB_DIR)/$(notdir $(MAIN_BOOT_OBJ))
|
||||||
|
|
||||||
# Improve later
|
# Improve later
|
||||||
$(SPLASH_IMAGE): ressources/Splash.png
|
$(SPLASH_IMAGE): ressources/Splash.png
|
||||||
jaby_engine_fconv $< simple-tim full16 | cpp_out --name SplashScreen -o $@
|
jaby_engine_fconv $< simple-tim full16 | cpp_out --name SplashScreen -o $@
|
||||||
|
@ -33,7 +44,7 @@ $(SPLASH_IMAGE_NTSC): ressources/Splash_ntsc.png
|
||||||
jaby_engine_fconv $< simple-tim full16 | cpp_out --name SplashScreen -o $@
|
jaby_engine_fconv $< simple-tim full16 | cpp_out --name SplashScreen -o $@
|
||||||
|
|
||||||
#Rules section for default compilation and linking
|
#Rules section for default compilation and linking
|
||||||
all: $(SPLASH_IMAGE) $(SPLASH_IMAGE_NTSC) $(LIB_DIR)/$(ARTIFACT).a
|
all: $(SPLASH_IMAGE) $(SPLASH_IMAGE_NTSC) $(LIB_DIR)/$(ARTIFACT).a $(LIB_DIR)/$(notdir $(MAIN_BOOT_OBJ))
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr $(SPLASH_IMAGE)
|
rm -fr $(SPLASH_IMAGE)
|
||||||
|
|
Loading…
Reference in New Issue