aboutsummaryrefslogtreecommitdiff
path: root/sdk-modifications/libsrc/Makefile
blob: 6e2b4aba80cf5bba4b66e355ef63b8fe564607e0 (plain)
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
62
63
64
65
66
67
CURR_DIR = ${shell pwd}
#CROSS :=#
#CROSS := /opt/mipsel-4.1.2-nopic/bin/
CROSS := /opt/mipsel-4.1.2-nopic/bin/


CC = $(CROSS)mipsel-linux-gcc
AR = $(CROSS)mipsel-linux-ar rcsv

TOPDIR = .
CONSOLE_DIR = $(TOPDIR)/console
FS_DIR = $(TOPDIR)/fs
KEY_DIR = $(TOPDIR)/key
ZLIB_DIR = $(TOPDIR)/zlib
DMA_DIR = $(TOPDIR)/dma

SRC :=

SSRC :=

INCLUDES := -I../include

INC := $(INCLUDES)

CFLAGS := -mips32 -O3 -mno-abicalls -fno-pic -fno-builtin \
	   -fno-exceptions -ffunction-sections -mlong-calls\
	   -fomit-frame-pointer -msoft-float -G 4

include $(CONSOLE_DIR)/console.mk
include $(FS_DIR)/fs.mk
include $(KEY_DIR)/key.mk
include $(ZLIB_DIR)/zlib.mk
include $(DMA_DIR)/dma.mk

#OBJS	:= $(addsuffix .o , $(basename $(notdir $(SRC))))
#SOBJS	:= $(addsuffix .o , $(basename $(notdir $(SSRC))))

OBJS	:= $(SRC:.c=.o)
SOBJS	:= $(SSRC:.S=.o)

all : depend libds2a.a

libds2a.a : $(OBJS) $(SOBJS)
	$(AR) $@ $(OBJS) $(SOBJS)
	cp $@ ../lib

clrscreen:
	@clear
	@clear

clean :
	rm -rf $(OBJS) $(SOBJS) *.a
	rm -f depend

.c.o :
	$(CC) $(CFLAGS) $(INC) -o $@ -c $<
.cpp.o :
	$(CC) $(CFLAGS) $(INC) -fno-rtti -fvtable-gc -o $@ -c $<
.S.o :
	$(CC) $(CFLAGS) $(INC) -D_ASSEMBLER_ -D__ASSEMBLY__ -o $@ -c $<

depend :	Makefile
	$(CC) -MM $(CFLAGS) $(INC) $(SSRC) $(SRC) > $@

sinclude depend