Subversion Repositories Kolibri OS

Rev

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

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