A shell that runs x86_64 assembly
c
x86-64
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 586B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. GCC=gcc
  2. AS=as
  3. LD=ld
  4. ASFLAGS=--64
  5. LDFLAGS=-s -melf_x86_64
  6. CFLAGS=-Wall
  7. CLDFLAGS=-s
  8. # To build with debugging symbols
  9. ifeq ($(DEBUG), 1)
  10. ASFLAGS += -DDEBUG=1 --gdwarf-5 -g
  11. LDFLAGS = -g -melf_x86_64
  12. LIB_FILE = src/lib$(LIBNAME)_dbg.a
  13. CFLAGS += -g
  14. CLDFLAGS = -g
  15. endif
  16. C_SRCS=$(wildcard *.c)
  17. C_OBJ=$(C_SRCS:.c=.o)
  18. all: child asmsh
  19. asmsh: $(C_OBJ)
  20. $(GCC) $(CLDFLAGS) -o $@ $<
  21. $(C_OBJ): %.o: %.c Makefile
  22. $(GCC) $(CFLAGS) -o $@ -c $<
  23. child: child.o
  24. $(LD) $(LDFLAGS) -o $@ $<
  25. child.o: child.s Makefile
  26. $(AS) $(ASFLAGS) -o $@ $<
  27. .PHONY: clean
  28. clean:
  29. -rm -f $(C_OBJ) child.o