-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
49 lines (43 loc) · 985 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# makefile
# Used for building executables from 64-bit x86 assembly language
#
# Programmer: Mayer Goldberg, 2023
NASM_EXE = nasm
NASM_OPTIONS = -g
NASM_OPTIONS_64 = -f elf64
NASM_COMMAND_64 = $(NASM_EXE) $(NASM_OPTIONS) $(NASM_OPTIONS_64) \
-l $*.lst $<
GCC_EXE = gcc
GCC_OPTIONS = -g
GCC_OPTIONS_64 = -m64 -no-pie
GCC_COMMAND_64 = $(GCC_EXE) $(GCC_OPTIONS) $(GCC_OPTIONS_64) -o $* $*.o
.SUFFIXES: .asm .o .s
%.o: %.asm
$(NASM_COMMAND_64)
%: %.o
$(GCC_COMMAND_64)
%.objdump: %
objdump -l -F -g -M intel-mnemonic -S --wide -d -s $* > $*.objdump
a2ps \
--landscape \
-sPAPERSIZE=a4 \
-R \
--columns=1 \
--pretty-print=nasm \
--highlight-level=heavy \
--line-numbers=1 \
$*.objdump -o $*_objdump.ps
ps2pdf -sPAPERSIZE=a4 $*_objdump.ps
rm -f $*.ps
%.pdf: %.asm
a2ps \
--landscape \
-R \
--columns=1 \
--pretty-print=nasm \
--highlight-level=heavy \
--line-numbers=1 \
$*.asm -o $*.ps
ps2pdf -sPAPERSIZE=a4 $*.ps
rm -f $*.ps
# end of input