Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. i686-elf-gcc -T linker.ld -o bin/kernel.bin -ffreestanding -O2 -nostdlib
  2. src/boot.o src/gdt.o src/cgdt.o src/kernel.o -lgcc
  3. src/cgdt.o: In function `gdt_set_gate':
  4. cgdt.c:(.text+0x0): multiple definition of `gdt_set_gate'
  5. src/gdt.o:gdt.c:(.text+0x0): first defined here
  6. src/cgdt.o: In function `gdt_install':
  7. cgdt.c:(.text+0x70): multiple definition of `gdt_install'
  8. src/gdt.o:gdt.c:(.text+0x70): first defined here
  9. src/gdt.o: In function `gdt_install':
  10. gdt.c:(.text+0x17a): undefined reference to `gdt_flush'
  11. src/cgdt.o: In function `gdt_install':
  12. cgdt.c:(.text+0x17a): undefined reference to `gdt_flush'
  13. collect2: error: ld returned 1 exit status
  14. Makefile:17: recipe for target 'link' failed
  15. make: *** [link] Error 1
  16.  
  17. CC=i686-elf-gcc
  18. AS=i686-elf-as
  19. LINKER=i686-elf-gcc
  20.  
  21. CFLAGS=-std=gnu99 -ffreestanding -O2 -Wall -Wextra -I./src/include
  22. LDFLAGS=-T linker.ld
  23.  
  24. C_SOURCES = $(shell ls src/*.c)
  25. ASM_SOURCES = $(shell ls src/*.s)
  26. OBJECTS = $(ASM_SOURCES:.s=.o) $(C_SOURCES:.c=.o)
  27.  
  28. all: $(OBJECTS) link
  29. clean:
  30. -rm ./src/*.o
  31.  
  32. link:
  33. $(LINKER) $(LDFLAGS) -o bin/kernel.bin -ffreestanding -O2 -nostdlib $(OBJECTS) -lgcc
  34.  
  35. .c.o:
  36. $(CC) $(CFLAGS) -c $< -o $@
  37.  
  38. .s.o:
  39. $(AS) $< -o $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement