Subversion Repositories Kolibri OS

Rev

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

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