blob: bb3a68715fae1fbb500471c60c9865f321977bae (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# PSn00bSDK library makefile
# Part of the PSn00bSDK Project
# 2019 - 2021 Lameguy64 / Meido-Tek Productions
## Settings
PSN00BSDK_LIBS ?= ..
include ../../psn00bsdk-setup.mk
# Project target name
TARGET = libc.a
## Files
# Searches for C, C++ and S (assembler) files in local directory
CFILES = $(notdir $(wildcard *.c))
CXXFILES= $(notdir $(wildcard *.cxx))
AFILES = $(notdir $(wildcard *.s))
# Create names for object files
OFILES = $(addprefix build/,$(CFILES:.c=.o)) \
$(addprefix build/,$(CXXFILES:.cxx=.o)) \
$(addprefix build/,$(AFILES:.s=.o))
# Project specific includes and libraries
# (use -I for include dirs, -L for library dirs, -l for static libraries)
INCLUDE +=
LIBDIRS +=
LIBS +=
## Build rules
all: build/$(TARGET)
build/$(TARGET): $(OFILES)
@mkdir -p $(dir $@)
# "Import" libgcc's contents
cp $(GCC_BASE)/lib/gcc/$(PREFIX)/$(GCC_VERSION)/libgcc.a ./$@
$(AR) rs $@ $(OFILES)
build/%.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS_LIB) $(INCLUDE) -c $< -o $@
build/%.o: %.cxx
@mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS_LIB) $(INCLUDE) -c $< -o $@
build/%.o: %.s
@mkdir -p $(dir $@)
$(CC) $(AFLAGS_LIB) $(INCLUDE) -c $< -o $@
install:
ifneq ($(PSN00BSDK_LIBS), "..")
@mkdir -p $(PSN00BSDK_LIBS)
endif
cp build/$(TARGET) $(PSN00BSDK_LIBS)/$(TARGET)
clean:
rm -rf build
|