bffee3a25280eb8363b311456dc7d24af958e6a5
[external/syslinux.git] / com32 / sysdump / Makefile
1 ## -----------------------------------------------------------------------
2 ##
3 ##   Copyright 2001-2008 H. Peter Anvin - All Rights Reserved
4 ##   Copyright 2010 Intel Corporation; author: H. Peter Anvin
5 ##
6 ##   This program is free software; you can redistribute it and/or modify
7 ##   it under the terms of the GNU General Public License as published by
8 ##   the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
9 ##   Boston MA 02110-1301, USA; either version 2 of the License, or
10 ##   (at your option) any later version; incorporated herein by reference.
11 ##
12 ## -----------------------------------------------------------------------
13
14 ##
15 ## Simple menu system
16 ##
17
18 topdir = ../..
19 include ../MCONFIG
20 -include $(topdir)/version.mk
21
22 LIBS       = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
23 LNXLIBS    = ../libutil/libutil_lnx.a
24
25 MODULES   = sysdump.c32
26 TESTFILES =
27
28 SRCS = $(wildcard *.c)
29 OBJS = $(patsubst %.c,%.o,$(SRCS))
30
31 # The DATE is set on the make command line when building binaries for
32 # official release.  Otherwise, substitute a hex string that is pretty much
33 # guaranteed to be unique to be unique from build to build.
34 ifndef HEXDATE
35 HEXDATE := $(shell $(PERL) $(topdir)/now.pl $(SRCS) $(wildcard *.h))
36 endif
37 ifndef DATE
38 DATE    := $(shell sh $(topdir)/gen-id.sh $(VERSION) $(HEXDATE))
39 endif
40
41 CFLAGS    += -DDATE='"$(DATE)"'
42
43 all: $(MODULES) $(TESTFILES)
44
45 sysdump.elf : $(OBJS) $(LIBS) $(C_LIBS)
46         $(LD) $(LDFLAGS) -o $@ $^
47
48 tidy dist:
49         rm -f *.o *.lo *.a *.lst *.elf .*.d *.tmp
50
51 clean: tidy
52         rm -f *.lnx
53
54 spotless: clean
55         rm -f *.lss *.c32 *.com
56         rm -f *~ \#*
57
58 install:
59
60 -include .*.d