-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (32 loc) · 1.19 KB
/
Makefile
File metadata and controls
47 lines (32 loc) · 1.19 KB
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
###################################
Ps4Sdk ?= $(CURDIR)/..
target ?= ps4_lib_no_all
BuildPath := $(Ps4Sdk)/build
OutPath := $(Ps4Sdk)/lib
###################################
include $(Ps4Sdk)/make/ps4sdk.mk
###################################
define generateCObject
$(patsubst %,$(BuildPath)/%,$(patsubst %.c,%.c.o,$(1))): $(1)
$$(dirp)
$$(compile)
endef
define generateSObject
$(patsubst %,$(BuildPath)/%,$(patsubst %.s,%.s.o,$(1))): $(1)
$$(dirp)
$$(assemble)
endef
define generateTarget
$(foreach i,$(call findwildcard, $(1)source/, *.c),$(call generateCObject,$(i)))
$(foreach i,$(call findwildcard, $(1)source/, *.s),$(call generateSObject,$(i)))
$(OutPath)/libPs4_common_$(subst /,_,$(patsubst %/,%,$(1))).a: $(patsubst %,$(BuildPath)/%, $(patsubst %.c,%.c.o,$(call findwildcard, $(1)source/, *.c)) $(patsubst %.s,%.s.o,$(call findwildcard, $(1)source/, *.s)))
$$(dirp)
$$(archive)
all:: $(OutPath)/libPs4_common_$(subst /,_,$(patsubst %/,%,$(1))).a
clean::
rm -fR $(BuildPath)/$(subst /,,$(strip $(1))) $(OutPath)/libPs4_common_$(subst /,_,$(patsubst %/,%,$(1))).a
endef
define generateTargets
$(foreach i,$(1),$(call generateTarget,$(i)))
endef
$(eval $(call generateTargets,$(wildcard */)))