Makfile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Makefile_64 for nasm assembly code (and corresponding C code)
  2. # for 64-bit operating systems with 64-bit gcc and nasm
  3. # on your system -m64 may be optional on gcc to use 8GB of ram
  4. all: hello_64.out printf1_64.out printf2_64.out \
  5. intarith_64.out fltarith_64.out fib_64l.out fib_64m.out
  6. hello_64.out: hello_64.asm
  7. nasm -f elf64 -l hello_64.lst hello_64.asm
  8. gcc -m64 -o hello_64 hello_64.o
  9. ./hello_64 > hello_64.out
  10. cat hello_64.out
  11. gcc -m64 hello.c
  12. ./a.out > hello.outc
  13. rm -f a.out
  14. printf1_64.out: printf1_64.asm printf1_64.c
  15. nasm -f elf64 -l printf1_64.lst printf1_64.asm
  16. gcc -m64 -o printf1_64 printf1_64.o
  17. ./printf1_64 > printf1_64.out
  18. cat printf1_64.out
  19. gcc -m64 printf1_64.c
  20. ./a.out > printf1_64.outc
  21. rm -f a.out
  22. printf2_64.out: printf2_64.asm printf2_64.c
  23. nasm -f elf64 -l printf2_64.lst printf2_64.asm
  24. gcc -m64 -o printf2_64 printf2_64.o
  25. ./printf2_64 > printf2_64.out
  26. cat printf2_64.out
  27. gcc -m64 printf2_64.c
  28. ./a.out > printf2_64.outc
  29. rm -f a.out
  30. intarith_64.out: intarith_64.asm intarith_64.c
  31. nasm -f elf64 -l intarith_64.lst intarith_64.asm
  32. gcc -m64 -o intarith_64 intarith_64.o
  33. ./intarith_64 > intarith_64.out
  34. cat intarith_64.out
  35. gcc -m64 intarith_64.c
  36. ./a.out > intarith_64.outc
  37. rm -f a.out
  38. fltarith_64.out: fltarith_64.asm fltarith_64.c
  39. nasm -f elf64 -l fltarith_64.lst fltarith_64.asm
  40. gcc -m64 -o fltarith_64 fltarith_64.o
  41. ./fltarith_64 > fltarith_64.out
  42. cat fltarith_64.out
  43. gcc -m64 fltarith_64.c
  44. ./a.out > fltarith_64.outc
  45. rm -f a.out
  46. fib_64l.out: fib_64l.asm fib.c
  47. nasm -f elf64 -l fib_64l.lst fib_64l.asm
  48. gcc -m64 -o fib_64l fib_64l.o
  49. ./fib_64l > fib_64l.out
  50. cat fib_64l.out
  51. gcc -m64 fib.c
  52. ./a.out > fib.outc
  53. rm -f a.out
  54. fib_64m.out: fib_64m.asm
  55. nasm -f elf64 -l fib_64m.lst fib_64m.asm
  56. gcc -m64 -o fib_64m fib_64m.o
  57. ./fib_64m > fib_64m.out
  58. cat fib_64m.out
  59. recompile:
  60. rm -f *.out
  61. rm -f *.outc
  62. make all
  63. clean: # for moving to another platform, keeping results
  64. rm -f hello_64
  65. rm -f printf1_64
  66. rm -f printf2_64
  67. rm -f intarith_64
  68. rm -f fltarith_64
  69. rm -f fib_64l
  70. rm -f fib_64m
  71. rm -f a.out
  72. rm -f *~
  73. rm -f core*
  74. rm -f *.o
  75. initial:
  76. rm -f *_64.out
  77. rm -f *_64.outc
  78. rm -f *_64.lst
  79. rm -f *.s
  80. make clean
  81. web:
  82. chgrp cseeweb *
  83. chmod go+rx *
  84. chmod g+w *