Debian Codegraph @

Makefile

raw ◀ ▶
1 Debian patch touch this file
1 # 1. edit you OS if you want....
2
3 OS=LINUX
4 #OS=FREEBSD
5 #OS=OPENBSD
6 #OS=NETBSD
7
8 # 2. edit dest dir prefix if you want....
9
10 PREFIX='/usr/local'
11
12 # 3. for programmers only: debugging in 64 bit Linux
13 DEBUG=false
14 #DEBUG=true
15
16 # 4. decide for nasm or yasm assembler (for 64 bit Linux version only)
17 NASM_OR_YASM=nasm
18 #NASM_OR_YASM=yasm
19
20 EXMODE=SED
21
22 #----------------------do not edit below line-------------------------------
23
24 BINDIR='$(PREFIX)/bin'
25 MANSEC='1'
•26 MANDIR='$(PREFIX)/share/man/man$(MANSEC)'
27
28 ASOURCES=e3.asm e3.h
29 AFLAGS = -w+orphan-labels -f elf
30
31 ifeq ($(NASM_OR_YASM),nasm)
32 ASSEMBLER64=nasm -O2 -g -w+orphan-labels -f elf64 -o e3.o e3.tmp -l e3nasm64.lst -DLINUX -DSED -DAMD64
33 else
34 ASSEMBLER64=yasm -g STABS -a x86 -m amd64 -f elf64 -p nasm -L nasm $(AFLAGS) -l e3yasm64.lst -o e3.o -DLINUX -DSED -DYASM -DAMD64 e3.tmp
35 endif
36
37 #---------------- default--------------------------
38 all: 32
39
40 #---------------- 32 bit LINUX (and perhaps BSD) --
41
42 32: $(ASOURCES) Makefile
43 ifeq ($(OS),LINUX)
44 nasm -O2 -f bin -l e3.lst -o e3 e3.asm -DCRIPLED_ELF=1 -D$(OS) -D$(EXMODE)
45 chmod +x e3
46 else
47 echo $(ASVER)
48 nasm -O2 $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -D$(EXMODE)
49 ld -s -o e3 e3.o
50 strip --remove-section .comment e3
51 endif
•52
53
54 # ------------- 64 bit L I N U X ------------------
55
56 64: $(ASOURCES) Makefile
57 cat e3.asm | sed -f e3_32to64.sed >e3.tmp
58 $(ASSEMBLER64)
59 ld -b elf64-x86-64 --oformat elf64-x86-64 -o e3 e3.o
60 ifneq ($(DEBUG),true)
61 strip e3
62 endif
63 ln -sf e3 e3ws
64 ln -sf e3 e3em
65 ln -sf e3 e3pi
66 ln -sf e3 e3vi
67 ln -sf e3 e3ne
68
69 # -------------------------------------------------
70
71 install: e3
72 install -d $(PREFIX) $(BINDIR) $(MANDIR)
73 install -m 755 e3 $(BINDIR)
•74 cd $(BINDIR) && ln -s e3 e3ws
75 cd $(BINDIR) && ln -s e3 e3em
76 cd $(BINDIR) && ln -s e3 e3pi
77 cd $(BINDIR) && ln -s e3 e3vi
78 cd $(BINDIR) && ln -s e3 e3ne
79 install -m 644 e3.man $(MANDIR)/e3.$(MANSEC)
80
81 clean:
82 rm -f e3*.o e3*.lst e3.tmp e3 e3em e3pi e3vi e3ws e3ne *~