9 IDIRS
:= -I
$(PS4SDK
)/include -I.
-Iinclude
10 LDIRS
:= -L
$(PS4SDK
) -L.
-Llib
11 CFLAGS
:= $(IDIRS
) -O2
-fno-builtin
-nostartfiles
-nostdlib
-Wall
-masm
=intel
-march
=btver2
-mtune
=btver2
-m64
-mabi
=sysv
-mcmodel
=large
-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
)).bin
22 $(TARGET
): $(ODIR
) $(OBJS
)
23 $(CC
) $(PS4SDK
)/crt0.s
$(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