mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-22 05:21:15 +01:00
Build libcrt.a instead of using separate object files.
This commit is contained in:
parent
8aa77c9ee6
commit
5c91545658
15
crt/Makefile
15
crt/Makefile
@ -3,22 +3,23 @@ include $(WUT_ROOT)/rules/ppc.mk
|
||||
|
||||
CFILES := $(wildcard *.c)
|
||||
SFILES := $(wildcard *.S)
|
||||
CRT0 := crt0.o
|
||||
OFILES := $(CFILES:.c=.o) $(SFILES:.S=.o)
|
||||
OUTPUT := libcrt
|
||||
|
||||
STUBS := $(SFILES:.S=.o) $(CFILES:.c=.o)
|
||||
|
||||
all: $(STUBS) $(CRT0)
|
||||
all: $(OUTPUT).a $(OFILES)
|
||||
|
||||
clean:
|
||||
@echo "[RM] $(notdir $(CRT0))"
|
||||
@rm -f $(STUBS) $(CRT0)
|
||||
@echo "[RM] $(notdir $(OUTPUT))"
|
||||
@rm -f $(OFILES) $(OUTPUT).a
|
||||
|
||||
install: all
|
||||
@mkdir -p $(WUT_ROOT)/lib
|
||||
@cp -f *.o $(WUT_ROOT)/lib
|
||||
@cp -f *.a $(WUT_ROOT)/lib
|
||||
|
||||
%.o: %.S
|
||||
@echo "[CC] $(notdir $<)"
|
||||
@$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(OUTPUT).a: $(OFILES)
|
||||
|
||||
.PHONY: all clean
|
||||
|
@ -1,7 +1,7 @@
|
||||
LIBPATHS := -L$(WUT_ROOT)/lib
|
||||
CFLAGS := -I$(WUT_ROOT)/include -fno-builtin -ffreestanding
|
||||
CXXFLAGS := $(CFLAGS)
|
||||
LDFLAGS := -nostdlib -nostartfiles $(WUT_ROOT)/lib/crt0.o $(WUT_ROOT)/lib/libgcc2.o -T $(WUT_ROOT)/rules/rpl.ld -pie -fPIE -z common-page-size=64 -z max-page-size=64 -lcoreinit
|
||||
LDFLAGS := -nostdlib -nostartfiles -T $(WUT_ROOT)/rules/rpl.ld -pie -fPIE -z common-page-size=64 -z max-page-size=64 -lcoreinit -lcrt
|
||||
ELF2RPL := $(WUT_ROOT)/bin/elf2rpl
|
||||
|
||||
include $(WUT_ROOT)/rules/base.mk
|
||||
|
Loading…
x
Reference in New Issue
Block a user