diff options
| author | John Wilbert M. Villamor <lameguy64@gmail.com> | 2019-07-17 11:30:07 +0800 |
|---|---|---|
| committer | John Wilbert M. Villamor <lameguy64@gmail.com> | 2019-07-17 11:30:07 +0800 |
| commit | 0d4345a9bf2623df079c50a3bc73cbb7deca1176 (patch) | |
| tree | 6cda70b844f39fc2d65a806b91a6010066433b56 /libpsn00b/libc/makefile | |
| parent | b956c5391b955e793a4d54572aa58872b4c66c30 (diff) | |
| download | psn00bsdk-0d4345a9bf2623df079c50a3bc73cbb7deca1176.tar.gz | |
Added C++ support, updated build instructions and makefiles, consolidated libc and libgcc (during build process), libraries now v0.12b and more
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 $@) |
