diff options
Diffstat (limited to 'libpsn00b/libc/makefile')
| -rw-r--r-- | libpsn00b/libc/makefile | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/libpsn00b/libc/makefile b/libpsn00b/libc/makefile index feadbdb..67f2284 100644 --- a/libpsn00b/libc/makefile +++ b/libpsn00b/libc/makefile @@ -2,20 +2,20 @@ # Part of the PSn00bSDK Project # 2019 Lameguy64 / Meido-Tek Productions -PREFIX = mipsel-unknown-elf- +include ../common.mk TARGET = ../libc.a -CFILES = $(notdir $(wildcard ./*.c)) -AFILES = $(notdir $(wildcard ./*.s)) -OFILES = $(addprefix build/,$(CFILES:.c=.o) $(AFILES:.s=.o)) +CFILES = $(notdir $(wildcard ./*.c)) +CXXFILES = $(notdir $(wildcard ./*.cxx)) +AFILES = $(notdir $(wildcard ./*.s)) +OFILES = $(addprefix build/,$(CFILES:.c=.o) $(CXXFILES:.cxx=.o) $(AFILES:.s=.o)) -INCLUDE = -I../include - -CFLAGS = -O2 -msoft-float -fno-builtin -fdata-sections -ffunction-sections -Wa,--strip-local-absolute -AFLAGS = -msoft-float -Wa,--strip-local-absolute +CFLAGS = -g -O2 -msoft-float -fno-builtin -fdata-sections -ffunction-sections -Wa,--strip-local-absolute +AFLAGS = -g -msoft-float -Wa,--strip-local-absolute CC = $(PREFIX)gcc +CXX = $(PREFIX)g++ AS = $(PREFIX)as AR = $(PREFIX)ar RANLIB = $(PREFIX)ranlib @@ -23,12 +23,17 @@ RANLIB = $(PREFIX)ranlib all: $(TARGET) $(TARGET): $(OFILES) - $(AR) cr $(TARGET) $(OFILES) + cp $(GCC_BASE)/lib/gcc/mipsel-unknown-elf/$(GCC_VERSION)/libgcc.a ./$(TARGET) + $(AR) r $(TARGET) $(OFILES) $(RANLIB) $(TARGET) build/%.o: %.c @mkdir -p $(dir $@) $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +build/%.o: %.cxx + @mkdir -p $(dir $@) + $(CXX) $(CFLAGS) $(INCLUDE) -c $< -o $@ build/%.o: %.s @mkdir -p $(dir $@) |
