Subversion Repositories Kolibri OS

Rev

Rev 1872 | Rev 1966 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1872 Rev 1877
1
CC = gcc
1
CC = gcc
2
AS = as
2
AS = as
3
 
3
 
4
DRV_TOPDIR   = $(CURDIR)/..
4
DRV_TOPDIR   = $(CURDIR)/..
5
DRV_INCLUDES = $(DRV_TOPDIR)/include
5
DRV_INCLUDES = $(DRV_TOPDIR)/include
6
 
6
 
7
INCLUDES = 	-I$(DRV_INCLUDES) -I$(DRV_INCLUDES)/linux -I$(DRV_INCLUDES)/linux/asm
7
INCLUDES = 	-I$(DRV_INCLUDES) -I$(DRV_INCLUDES)/linux -I$(DRV_INCLUDES)/linux/asm
8
DEFINES  = 	-DKOLIBRI -D__KERNEL__ -DCONFIG_X86_32 
8
DEFINES  = 	-DKOLIBRI -D__KERNEL__ -DCONFIG_X86_32 
9
CFLAGS = 	-c -Os $(INCLUDES) $(DEFINES) -march=i486 -fomit-frame-pointer -fno-builtin-printf 
9
CFLAGS = 	-c -Os $(INCLUDES) $(DEFINES) -march=i486 -fomit-frame-pointer -fno-builtin-printf \
10
 
10
-mno-stack-arg-probe -mpreferred-stack-boundary=2 -mincoming-stack-boundary=2
-
 
11
 
11
NAME:=	  libddk
12
NAME:=	  libddk
12
 
13
 
13
CORE_SRC=	core.S
14
CORE_SRC=	core.S
14
 
15
 
15
 
16
 
16
NAME_SRCS:=  				\
17
NAME_SRCS:=  				\
17
		debug/dbglog.c		\
18
		debug/dbglog.c		\
18
		debug/chkstk.S		\
19
		debug/chkstk.S		\
19
           	io/create.c		\
20
           	io/create.c		\
20
           	io/finfo.c		\
21
           	io/finfo.c		\
21
           	io/ssize.c		\
22
           	io/ssize.c		\
22
           	io/write.c		\
23
           	io/write.c		\
23
		linux/idr.c		\
24
		linux/idr.c		\
24
		linux/firmware.c	\
25
		linux/firmware.c	\
25
		linux/list_sort.c	\
26
		linux/list_sort.c	\
26
		linux/dmapool.c		\
27
		linux/dmapool.c		\
27
		linux/ctype.c		\
28
		linux/ctype.c		\
28
		malloc/malloc.c		\
29
		malloc/malloc.c		\
29
		stdio/vsprintf.c	\
30
		stdio/vsprintf.c	\
30
		string/_memmove.S 	\
31
		string/_memmove.S 	\
31
		string/_strncat.S 	\
32
		string/_strncat.S 	\
32
		string/_strncmp.S 	\
33
		string/_strncmp.S 	\
33
		string/_strncpy.S 	\
34
		string/_strncpy.S 	\
34
		string/_strnlen.S 	\
35
		string/_strnlen.S 	\
35
		string/bcmp.S 		\
36
		string/bcmp.S 		\
36
		string/bcopy.S 		\
37
		string/bcopy.S 		\
37
		string/bzero.S 		\
38
		string/bzero.S 		\
38
		string/index.S 		\
39
		string/index.S 		\
39
		string/memchr.S 	\
40
		string/memchr.S 	\
40
		string/memcmp.S 	\
41
		string/memcmp.S 	\
41
		string/memcpy.S 	\
42
		string/memcpy.S 	\
42
		string/memmove.S 	\
43
		string/memmove.S 	\
43
		string/memset.S 	\
44
		string/memset.S 	\
44
		string/rindex.S 	\
45
		string/rindex.S 	\
45
		string/strcat.S 	\
46
		string/strcat.S 	\
46
		string/strchr.S 	\
47
		string/strchr.S 	\
47
		string/strcmp.S 	\
48
		string/strcmp.S 	\
48
		string/strcpy.S 	\
49
		string/strcpy.S 	\
49
		string/strlen.S 	\
50
		string/strlen.S 	\
50
		string/strncat.S 	\
51
		string/strncat.S 	\
51
		string/strncmp.S 	\
52
		string/strncmp.S 	\
52
		string/strncpy.S 	\
53
		string/strncpy.S 	\
53
		string/strnlen.S 	\
54
		string/strnlen.S 	\
54
		string/strrchr.S 
55
		string/strrchr.S 
55
 
56
 
56
 
57
 
57
 
58
 
58
NAME_OBJS =  $(patsubst %.S, %.o, $(patsubst %.asm, %.o,\
59
NAME_OBJS =  $(patsubst %.S, %.o, $(patsubst %.asm, %.o,\
59
             $(patsubst %.c, %.o, $(NAME_SRCS))))
60
             $(patsubst %.c, %.o, $(NAME_SRCS))))
60
 
61
 
61
 
62
 
62
TARGET  = $(NAME).a 
63
TARGET  = $(NAME).a 
63
 
64
 
64
all: $(TARGET) libcore.a
65
all: $(TARGET) libcore.a
65
 
66
 
66
 
67
 
67
$(TARGET): $(NAME_OBJS) $(NAME_SRC) Makefile
68
$(TARGET): $(NAME_OBJS) $(NAME_SRC) Makefile
68
	$(AR) cvrs $@ $(NAME_OBJS)
69
	$(AR) cvrs $@ $(NAME_OBJS)
69
 
70
 
70
 
71
 
71
libcore.a: core.S Makefile
72
libcore.a: core.S Makefile
72
	$(AS) -o core.o $<
73
	$(AS) -o core.o $<
73
	$(LD) -shared -s --out-implib $@ --output-def core.def -o core.dll core.o
74
	$(LD) -shared -s --out-implib $@ --output-def core.def -o core.dll core.o
74
	
75
	
75
%.o: %.S Makefile
76
%.o: %.S Makefile
76
	$(CC) $(CFLAGS) -o $@ $<
77
	$(CC) $(CFLAGS) -o $@ $<
77
 
78
 
78
%.o: %.c Makefile
79
%.o: %.c Makefile
79
	$(CC) $(CFLAGS) -o $@ $<
80
	$(CC) $(CFLAGS) -o $@ $<
80
 
81
 
81
%.o:>
82
%.o:>
82
>
83
>