Copy library instead of building it directly

This commit is contained in:
Jaby 2022-08-23 20:05:53 +02:00
parent 83b2cb465e
commit b872a8db15
2 changed files with 14 additions and 8 deletions

View File

@ -79,11 +79,6 @@ $(OUTPUT_DIR)/%.o: $$(subst !super,..,%.s)
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(CC) $(ARCHFLAGS) -I$(PCSX_REDUX) -g -c -o $@ $< $(CC) $(ARCHFLAGS) -I$(PCSX_REDUX) -g -c -o $@ $<
#Linking rule
$(TARGET).a: $(OBJS)
@mkdir -p $(dir $@)
$(AR) rcs $(TARGET).a $(OBJS)
$(TARGET).elf: $(OBJS) $(TARGET).elf: $(OBJS)
$(LD) -o $(TARGET).elf $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS) $(LD) -o $(TARGET).elf $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS)

View File

@ -1,13 +1,24 @@
ARTIFACT = libJabyEngine ARTIFACT = libJabyEngine
BUILD_DIR = ../../lib BUILD_DIR = bin
include ../../lib/Wildcard.mk include ../../lib/Wildcard.mk
SRCS = $(call rwildcard, src, c cpp) SRCS = $(call rwildcard, src, c cpp)
include ../../lib/Makefile include ../../lib/Makefile
LIB_DIR = ../../lib/$(CONFIG_NAME)
#Linking rule
$(TARGET).a: $(OBJS)
@mkdir -p $(dir $@)
$(AR) rcs $(TARGET).a $(OBJS)
$(LIB_DIR)/$(ARTIFACT).a: $(TARGET).a
@mkdir -p $(LIB_DIR)
cp $(TARGET).a $(LIB_DIR)/$(ARTIFACT).a
#Rules section for default compilation and linking #Rules section for default compilation and linking
all: $(TARGET).a all: $(LIB_DIR)/$(ARTIFACT).a
clean: clean:
rm -fr $(OUTPUT_DIR) rm -fr $(OUTPUT_DIR)
rm -fr $(LIB_DIR)/$(ARTIFACT).a