9 IDIRS
:= -I.
-I
$(PS4_SDK
)/include -Iinclude
10 LDIRS
:= -L.
-L
$(PS4_SDK
)/ -Llib
11 CFLAGS
:= $(IDIRS
) -O2
-fno-builtin
-nostartfiles
-nostdlib
-Wall
-masm
=intel
-march
=btver2
-mtune
=btver2
-m64
-mabi
=sysv
-DTEXT_ADDRESS
=$(TEXT
) -DDATA_ADDRESS
=$(DATA
)
12 SFLAGS
:= -nostartfiles
-nostdlib
-march
=btver2
-mtune
=btver2
13 LFLAGS
:= $(LDIRS
) -Ttext
=$(TEXT
) -Tdata
=$(DATA
)
14 CFILES
:= $(wildcard $(SDIR
)/*.c
)
15 SFILES
:= $(wildcard $(SDIR
)/*.s
)
16 OBJS
:= $(patsubst $(SDIR
)/%.c
, build
/%.o
, $(CFILES
)) $(patsubst $(SDIR
)/%.s
, build
/%.o
, $(SFILES
))
20 TARGET
= $(shell basename $(CURDIR
))
22 $(TARGET
): $(ODIR
) $(OBJS
)
23 $(CC
) $(ODIR
)/*.o
-o temp.t
$(CFLAGS
) $(LFLAGS
) $(LIBS
)
24 $(OBJCOPY
) -O binary temp.t
$(TARGET
)
27 $(ODIR
)/%.o
: $(SDIR
)/%.c
28 $(CC
) -c
-o
$@
$< $(CFLAGS
)
30 $(ODIR
)/%.o
: $(SDIR
)/%.s
31 $(AS
) -c
-o
$@
$< $(SFLAGS
)
39 rm -f
$(TARGET
) $(ODIR
)/*.o