Subversion Repositories Kolibri OS

Rev

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