Subversion Repositories Kolibri OS

Rev

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

  1.  
  2.  
  3.  
  4. CC = gcc
  5. AS = as
  6.  
  7. DRV_TOPDIR   = $(CURDIR)/..
  8. DRV_INCLUDES = $(DRV_TOPDIR)/include
  9.  
  10. INCLUDES =      -I$(DRV_INCLUDES) -I$(DRV_INCLUDES)/linux -I$(DRV_INCLUDES)/linux/asm
  11. DEFINES  =      -DKOLIBRI -D__KERNEL__ -DCONFIG_X86_32
  12. CFLAGS =        -c -O2 $(INCLUDES) $(DEFINES) -fomit-frame-pointer -fno-builtin-printf
  13.  
  14. NAME:=    libdrv
  15.  
  16. CORE_SRC=       core.S
  17.  
  18.  
  19. NAME_SRCS:=                             \
  20.                 debug/dbglog.c          \
  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/list_sort.c       \
  28.                 malloc/malloc.c         \
  29.                 stdio/icompute.c        \
  30.                 stdio/vsprintf.c        \
  31.                 stdio/doprnt.c          \
  32.                 stdio/chartab.c         \
  33.                 string/_memmove.S       \
  34.                 string/_strncat.S       \
  35.                 string/_strncmp.S       \
  36.                 string/_strncpy.S       \
  37.                 string/_strnlen.S       \
  38.                 string/memcpy.S         \
  39.                 string/memcmp.S         \
  40.                 string/memset.S         \
  41.                 string/strcat.S         \
  42.                 string/strchr.S         \
  43.                 string/strcpy.S         \
  44.                 string/strncpy.S        \
  45.                 string/strncmp.S        \
  46.                 string/strlen.S
  47.  
  48.  
  49.  
  50. NAME_OBJS =  $(patsubst %.S, %.o, $(patsubst %.asm, %.o,\
  51.              $(patsubst %.c, %.o, $(NAME_SRCS))))
  52.  
  53.  
  54. TARGET  = $(NAME).a
  55.  
  56. all: $(TARGET) libcore.a
  57.  
  58.  
  59. $(TARGET): $(NAME_OBJS) $(NAME_SRC) Makefile
  60.         $(AR) cvrs $@ $(NAME_OBJS)
  61.  
  62.  
  63. libcore.a: core.S Makefile
  64.         $(AS) -o core.o $<
  65.         $(LD) -shared -s --out-implib $@ --output-def core.def -o core.dll core.o
  66.        
  67. %.o: %.S Makefile
  68.         $(AS) -o $@ $<
  69.  
  70. %.o: %.c Makefile
  71.         $(CC) $(CFLAGS) -o $@ $<
  72.  
  73.