Skip to content

Commit 4519eb8

Browse files
committed
..
1 parent 771a780 commit 4519eb8

File tree

1 file changed

+8
-30
lines changed

1 file changed

+8
-30
lines changed

src/mips/common.mk

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,31 @@
11
PREFIX = mipsel-linux-gnu
22

33
CC = $(PREFIX)-gcc
4-
AR = $(PREFIX)-ar
5-
6-
## If "TLOAD_ADDR" was specified in the Makefile, pass it to the linker.
7-
ifneq ($(strip $(TLOAD_ADDR)),)
8-
LDFLAGS += -Wl,--defsym,TLOAD_ADDR=$(TLOAD_ADDR)
9-
endif
10-
11-
TARGETBASE = $(basename $(TARGET))
124

135
ARCHFLAGS = -march=mips1 -mabi=32 -EL -msoft-float -Wa,-msoft-float -fno-pic -mno-shared -mno-abicalls
14-
ARCHFLAGS += -mno-gpopt -fomit-frame-pointer -nostartfiles -nostdinc -fno-builtin -fno-pic -fno-stack-protector
15-
6+
CPPFLAGS = -mno-gpopt -fomit-frame-pointer
167
CPPFLAGS += -fno-builtin
178
CPPFLAGS += $(ARCHFLAGS)
189
CPPFLAGS += -I..
1910

20-
LDFLAGS += -Wl,-Map=$(TARGETBASE).map -nostdlib -T$(LDSCRIPT) -static -Wl,--gc-sections
21-
LDFLAGS += $(ARCHFLAGS) -L../ps1sdk
11+
LDFLAGS = -Wl,-Map=$(TARGET).map -nostdlib -T$(LDSCRIPT) -static -Wl,--gc-sections
12+
LDFLAGS += $(ARCHFLAGS)
2213

2314
LDFLAGS += -g -O3 -flto
2415
CPPFLAGS += -g -O3 -flto
2516

2617
OBJS += $(addsuffix .o, $(basename $(SRCS)))
2718

28-
all: $(TARGET)
29-
30-
../ps1sdk/libps1sdk.a:
31-
$(MAKE) -C ../ps1sdk all
19+
all: $(TARGET).bin
3220

3321
clean:
34-
rm -f $(OBJS) $(TARGETBASE).psx $(TARGETBASE).elf $(TARGETBASE).map $(TARGETBASE).bin $(TARGET)
22+
rm -f $(OBJS) $(TARGET).elf $(TARGET).map $(TARGET).bin
3523

36-
$(TARGETBASE).bin: $(TARGETBASE).elf
24+
$(TARGET).bin: $(TARGET).elf
3725
$(PREFIX)-objcopy -O binary $< $@
3826

39-
$(TARGETBASE).psx: $(TARGETBASE).elf
40-
$(PREFIX)-objcopy -O binary $< $@
41-
42-
$(TARGETBASE).a: $(OBJS)
43-
$(AR) cru $@ $(OBJS)
44-
45-
$(TARGETBASE).elf: $(OBJS) $(LIBS)
46-
$(CC) $(LDFLAGS) -g -o $(TARGETBASE).elf $(OBJS) $(LIBS)
47-
48-
%.o: %.S
49-
$(CC) $(CPPFLAGS) -I.. -g -c -o $@ $<
27+
$(TARGET).elf: $(OBJS)
28+
$(CC) $(LDFLAGS) -g -o $(TARGET).elf $(OBJS)
5029

5130
%.o: %.s
5231
$(CC) $(ARCHFLAGS) -I.. -g -c -o $@ $<
53-

0 commit comments

Comments
 (0)