syslinux.mk: $(MAKEDIR), not $(makefiledir)
[profile/ivi/syslinux.git] / mk / syslinux.mk
1 ## -*- makefile -*- -------------------------------------------------------
2 ##   
3 ##   Copyright 2008 H. Peter Anvin - All Rights Reserved
4 ##
5 ##   This program is free software; you can redistribute it and/or modify
6 ##   it under the terms of the GNU General Public License as published by
7 ##   the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
8 ##   Boston MA 02110-1301, USA; either version 2 of the License, or
9 ##   (at your option) any later version; incorporated herein by reference.
10 ##
11 ## -----------------------------------------------------------------------
12
13 ##
14 ## Common configurables
15 ##
16
17 # No builtin rules
18 MAKEFLAGS += -r
19 MAKE      += -r
20
21 BINDIR   = /usr/bin
22 SBINDIR  = /sbin
23 LIBDIR   = /usr/lib
24 DATADIR  = /usr/share
25 AUXDIR   = $(DATADIR)/syslinux
26 DIAGDIR  = $(AUXDIR)/diag
27 MANDIR   = /usr/man
28 INCDIR   = /usr/include
29 TFTPBOOT = /tftpboot
30 COM32DIR = $(AUXDIR)/com32
31
32 BOOTDIR     = /boot
33 EXTLINUXDIR = $(BOOTDIR)/extlinux
34
35 NASM     = nasm
36 NASMOPT  = -Ox
37
38 PERL     = perl
39 UPX      = upx
40
41 CHMOD    = chmod
42
43 CC       = gcc
44 gcc_ok   = $(shell tmpf=gcc_ok.$$$$.tmp; \
45                    if $(CC) $(GCCOPT) $(1) -c $(topdir)/dummy.c \
46                         -o $$tmpf 2>/dev/null ; \
47                    then echo '$(1)'; else echo '$(2)'; fi; \
48                    rm -f $$tmpf)
49
50 LD       = ld
51 OBJDUMP  = objdump
52 OBJCOPY  = objcopy
53 AR       = ar
54 NM       = nm
55 RANLIB   = ranlib
56 GZIPPROG = gzip
57 XZ       = xz
58 PNGTOPNM = pngtopnm
59 MCOPY    = mcopy
60 MFORMAT  = mformat
61 MKISOFS  = mkisofs
62 SED      = sed
63 WGET     = wget
64
65 com32    = $(topdir)/com32
66
67 # Common warnings we want for all gcc-generated code
68 GCCWARN := -W -Wall -Wstrict-prototypes
69 # Extremely useful variant for debugging...
70 #GCCWARN += -Wno-clobbered -Werror
71
72 # Common stanza to make gcc generate .*.d dependency files
73 MAKEDEPS = -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
74
75 # Dependencies that exclude system headers; use whenever we use
76 # header files from the platform.
77 UMAKEDEPS = -Wp,-MT,$@,-MMD,$(dir $@).$(notdir $@).d
78
79 # Items that are only appropriate during development; this file is
80 # removed when tarballs are generated.
81 -include $(MAKEDIR)/devel.mk
82
83 # Local additions, like -DDEBUG can go here
84 -include $(MAKEDIR)/local.mk