aboutsummaryrefslogtreecommitdiffstats
path: root/mk/syslinux.mk
blob: 92c5ebc4923c18e04eab616f5a8cfc1430f6b81b (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
## -*- makefile -*- ------------------------------------------------------
##   
##   Copyright 2008 H. Peter Anvin - All Rights Reserved
##
##   This program is free software; you can redistribute it and/or modify
##   it under the terms of the GNU General Public License as published by
##   the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
##   Boston MA 02110-1301, USA; either version 2 of the License, or
##   (at your option) any later version; incorporated herein by reference.
##
## -----------------------------------------------------------------------

##
## Common configurables
##

# No builtin rules
MAKEFLAGS += -r
MAKE      += -r

# Preserve intermediate files
.SECONDARY:

VPATH    = $(SRC)

BINDIR   = /usr/bin
SBINDIR  = /sbin
LIBDIR   = /usr/lib
DATADIR  = /usr/share
AUXDIR   = $(DATADIR)/syslinux
DIAGDIR  = $(AUXDIR)/diag
MANDIR	 = /usr/man
INCDIR   = /usr/include
TFTPBOOT = /tftpboot
COM32DIR = $(AUXDIR)/com32

BOOTDIR	    = /boot
EXTLINUXDIR = $(BOOTDIR)/extlinux

ifdef DEBUG
# This allows DEBUGOPT to be set from the command line
DEBUGOPT = -DDEBUG=$(DEBUG)
endif

NASM	 = nasm
NASMFLAGS  = -Ox $(DEBUGOPT)

PERL	 = perl
PYTHON	 = python
UPX	 = upx

CHMOD	 = chmod

CC	 = gcc
gcc_ok   = $(shell tmpf=gcc_ok.$$$$.tmp; \
		   if $(CC) $(GCCOPT) $(1) -c $(topdir)/dummy.c \
			-o $$tmpf 2>/dev/null ; \
		   then echo '$(1)'; else echo '$(2)'; fi; \
		   rm -f $$tmpf)

LD	 = ld
OBJDUMP	 = objdump
OBJCOPY  = objcopy
STRIP    = strip
AR       = ar
NM       = nm
RANLIB   = ranlib
STRIP	 = strip
GZIPPROG = gzip
XZ	 = xz
PNGTOPNM = pngtopnm
MCOPY    = mcopy
MFORMAT  = mformat
MKISOFS  = mkisofs
SED	 = sed
WGET	 = wget

CC_FOR_BUILD ?= $(CC)

# All supported CPU architectures
ARCHLIST    := i386 x86_64

# The architectures we are not currently building for
OTHERARCHES := $(filter-out $(ARCH),$(ARCHLIST))

com32    = $(topdir)/com32

# Architecture definition
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/) 
# on x86_64, ARCH has trailing whitespace
# strip white spaces in ARCH
ARCH ?= $(strip $(SUBARCH))

# Common warnings we want for all gcc-generated code
# WARNOPT is available for the user to specify additional warning flags
GCCWARN = -W -Wall -Wstrict-prototypes \
	  -Wno-implicit-fallthrough -Wno-format-truncation \
	  -Wno-stringop-overflow \
	  $(DEBUGOPT) $(WARNOPT)

# Common stanza to make gcc generate .*.d dependency files
MAKEDEPS = -MT $@ -MD -MF $(@D)/.$(@F).d

# Dependencies that exclude system headers; use whenever we use
# header files from the platform.
UMAKEDEPS = -MT $@ -MMD -MF $(@D)/.$(@F).d

# Version number
-include $(topdir)/version.mk

# Items that are only appropriate during development; this file is
# removed when tarballs are generated.
-include $(MAKEDIR)/devel.mk

# Local additions, like -DDEBUG can go here
-include $(MAKEDIR)/local.mk