Subversion Repositories Kolibri OS

Rev

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