Subversion Repositories Kolibri OS

Rev

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