Subversion Repositories Kolibri OS

Rev

Rev 1412 | Rev 1627 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. CC = gcc
  3. AS = as
  4.  
  5. DRV_TOPDIR   = $(CURDIR)/..
  6. DRV_INCLUDES = $(DRV_TOPDIR)/include
  7.  
  8. INCLUDES =      -I$(DRV_INCLUDES) -I$(DRV_INCLUDES)/linux -I$(DRV_INCLUDES)/linux/asm
  9. DEFINES  =      -DKOLIBRI -D__KERNEL__ -DCONFIG_X86_32
  10. CFLAGS =        -c -O2 $(INCLUDES) $(DEFINES) -fomit-frame-pointer -fno-builtin-printf
  11.  
  12. NAME:=    libddk
  13.  
  14. CORE_SRC=       core.S
  15.  
  16.  
  17. NAME_SRCS:=                             \
  18.                 debug/dbglog.c          \
  19.                 io/create.c             \
  20.                 io/finfo.c              \
  21.                 io/ssize.c              \
  22.                 io/write.c              \
  23.                 linux/idr.c             \
  24.                 linux/firmware.c        \
  25.                 linux/list_sort.c       \
  26.                 linux/dmapool.c         \
  27.                 malloc/malloc.c         \
  28.                 stdio/icompute.c        \
  29.                 stdio/vsprintf.c        \
  30.                 stdio/doprnt.c          \
  31.                 stdio/chartab.c         \
  32.                 string/_memmove.S       \
  33.                 string/_strncat.S       \
  34.                 string/_strncmp.S       \
  35.                 string/_strncpy.S       \
  36.                 string/_strnlen.S       \
  37.                 string/memcpy.S         \
  38.                 string/memcmp.S         \
  39.                 string/memset.S         \
  40.                 string/strcat.S         \
  41.                 string/strchr.S         \
  42.                 string/strcpy.S         \
  43.                 string/strncpy.S        \
  44.                 string/strncmp.S        \
  45.                 string/strlen.S
  46.  
  47.  
  48.  
  49. NAME_OBJS =  $(patsubst %.S, %.o, $(patsubst %.asm, %.o,\
  50.              $(patsubst %.c, %.o, $(NAME_SRCS))))
  51.  
  52.  
  53. TARGET  = $(NAME).a
  54.  
  55. all: $(TARGET) libcore.a
  56.  
  57.  
  58. $(TARGET): $(NAME_OBJS) $(NAME_SRC) Makefile
  59.         $(AR) cvrs $@ $(NAME_OBJS)
  60.  
  61.  
  62. libcore.a: core.S Makefile
  63.         $(AS) -o core.o $<
  64.         $(LD) -shared -s --out-implib $@ --output-def core.def -o core.dll core.o
  65.        
  66. %.o: %.S Makefile
  67.         $(AS) -o $@ $<
  68.  
  69. %.o: %.c Makefile
  70.         $(CC) $(CFLAGS) -o $@ $<
  71.  
  72.