Subversion Repositories Kolibri OS

Rev

Rev 1616 | Rev 1869 | 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/bcmp.S           \
  38.                 string/bcopy.S          \
  39.                 string/bzero.S          \
  40.                 string/index.S          \
  41.                 string/memchr.S         \
  42.                 string/memcmp.S         \
  43.                 string/memcpy.S         \
  44.                 string/memmove.S        \
  45.                 string/memset.S         \
  46.                 string/rindex.S         \
  47.                 string/strcat.S         \
  48.                 string/strchr.S         \
  49.                 string/strcmp.S         \
  50.                 string/strcpy.S         \
  51.                 string/strlen.S         \
  52.                 string/strncat.S        \
  53.                 string/strncmp.S        \
  54.                 string/strncpy.S        \
  55.                 string/strnlen.S        \
  56.                 string/strrchr.S
  57.  
  58.  
  59.  
  60. NAME_OBJS =  $(patsubst %.S, %.o, $(patsubst %.asm, %.o,\
  61.              $(patsubst %.c, %.o, $(NAME_SRCS))))
  62.  
  63.  
  64. TARGET  = $(NAME).a
  65.  
  66. all: $(TARGET) libcore.a
  67.  
  68.  
  69. $(TARGET): $(NAME_OBJS) $(NAME_SRC) Makefile
  70.         $(AR) cvrs $@ $(NAME_OBJS)
  71.  
  72.  
  73. libcore.a: core.S Makefile
  74.         $(AS) -o core.o $<
  75.         $(LD) -shared -s --out-implib $@ --output-def core.def -o core.dll core.o
  76.        
  77. %.o: %.S Makefile
  78.         $(CC) $(CFLAGS) -o $@ $<
  79.  
  80. %.o: %.c Makefile
  81.         $(CC) $(CFLAGS) -o $@ $<
  82.  
  83.