Merge branch 'pathbased' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into...
[profile/ivi/syslinux.git] / extlinux / Makefile
1 ## -----------------------------------------------------------------------
2 ##
3 ##   Copyright 2001-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., 53 Temple Place Ste 330,
8 ##   Boston MA 02111-1307, USA; either version 2 of the License, or
9 ##   (at your option) any later version; incorporated herein by reference.
10 ##
11 ## -----------------------------------------------------------------------
12
13 ##
14 ## Linux vfat, ext2/ext3/ext4 and btrfs installer
15 ##
16
17 topdir = ..
18 include $(topdir)/MCONFIG
19
20 OPTFLAGS = -g -Os
21 INCLUDES = -I. -I.. -I../libinstaller
22 CFLAGS   = $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
23            $(OPTFLAGS) $(INCLUDES)
24 LDFLAGS  = # -s
25
26 SRCS     = main.c \
27            ../libinstaller/syslxopt.c \
28            ../libinstaller/syslxcom.c \
29            ../libinstaller/setadv.c \
30            ../libinstaller/extlinux_bss_bin.c \
31            ../libinstaller/extlinux_sys_bin.c
32 OBJS     = $(patsubst %.c,%.o,$(notdir $(SRCS)))
33
34 .SUFFIXES: .c .o .i .s .S
35
36 VPATH = .:../libinstaller
37
38 all: installer
39
40 tidy dist:
41         -rm -f *.o *.i *.s *.a .*.d *.tmp
42
43 clean: tidy
44         -rm -f extlinux
45
46 spotless: clean
47         -rm -f *~
48
49 installer: extlinux
50
51 extlinux: $(OBJS)
52         $(CC) $(LDFLAGS) -o $@ $^
53
54 %.o: %.c
55         $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
56 %.i: %.c
57         $(CC) $(UMAKEDEPS) $(CFLAGS) -E -o $@ $<
58 %.s: %.c
59         $(CC) $(UMAKEDEPS) $(CFLAGS) -S -o $@ $<
60
61 -include .*.d *.tmp