Subversion Repositories Kolibri OS

Rev

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

  1.  
  2.  
  3. CC = gcc
  4. AS = as
  5.  
  6. DRV_TOPDIR   = $(CURDIR)/..
  7. DRV_INCLUDES = $(DRV_TOPDIR)/include
  8.  
  9. INCLUDES =      -I$(DRV_INCLUDES) -I$(DRV_INCLUDES)/linux -I$(DRV_INCLUDES)/linux/asm
  10. DEFINES  =      -DKOLIBRI -D__KERNEL__ -DCONFIG_X86_32
  11. CFLAGS =        -c -Os $(INCLUDES) $(DEFINES) -march=i486 -fomit-frame-pointer -fno-builtin-printf
  12.  
  13. NAME:=    libddk
  14.  
  15. CORE_SRC=       core.S
  16.  
  17.  
  18. NAME_SRCS:=                             \
  19.                 debug/dbglog.c          \
  20.                 io/create.c             \
  21.                 io/finfo.c              \
  22.                 io/ssize.c              \
  23.                 io/write.c              \
  24.                 linux/idr.c             \
  25.                 linux/firmware.c        \
  26.                 linux/list_sort.c       \
  27.                 linux/dmapool.c         \
  28.                 linux/ctype.c           \
  29.                 malloc/malloc.c         \
  30.                 stdio/vsprintf.c        \
  31.                 string/_memmove.S       \
  32.                 string/_strncat.S       \
  33.                 string/_strncmp.S       \
  34.                 string/_strncpy.S       \
  35.                 string/_strnlen.S       \
  36.                 string/bcmp.S           \
  37.                 string/bcopy.S          \
  38.                 string/bzero.S          \
  39.                 string/index.S          \
  40.                 string/memchr.S         \
  41.                 string/memcmp.S         \
  42.                 string/memcpy.S         \
  43.                 string/memmove.S        \
  44.                 string/memset.S         \
  45.                 string/rindex.S         \
  46.                 string/strcat.S         \
  47.                 string/strchr.S         \
  48.                 string/strcmp.S         \
  49.                 string/strcpy.S         \
  50.                 string/strlen.S         \
  51.                 string/strncat.S        \
  52.                 string/strncmp.S        \
  53.                 string/strncpy.S        \
  54.                 string/strnlen.S        \
  55.                 string/strrchr.S
  56.  
  57.  
  58.  
  59. NAME_OBJS =  $(patsubst %.S, %.o, $(patsubst %.asm, %.o,\
  60.              $(patsubst %.c, %.o, $(NAME_SRCS))))
  61.  
  62.  
  63. TARGET  = $(NAME).a
  64.  
  65. all: $(TARGET) libcore.a
  66.  
  67.  
  68. $(TARGET): $(NAME_OBJS) $(NAME_SRC) Makefile
  69.         $(AR) cvrs $@ $(NAME_OBJS)
  70.  
  71.  
  72. libcore.a: core.S Makefile
  73.         $(AS) -o core.o $<
  74.         $(LD) -shared -s --out-implib $@ --output-def core.def -o core.dll core.o
  75.        
  76. %.o: %.S Makefile
  77.         $(CC) $(CFLAGS) -o $@ $<
  78.  
  79. %.o: %.c Makefile
  80.         $(CC) $(CFLAGS) -o $@ $<
  81.  
  82.