1 ## -----------------------------------------------------------------------
3 ## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
4 ## Copyright 2010 Intel Corporation; author: H. Peter Anvin
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., 53 Temple Place Ste 330,
9 ## Boston MA 02111-1307, USA; either version 2 of the License, or
10 ## (at your option) any later version; incorporated herein by reference.
12 ## -----------------------------------------------------------------------
15 # Makefile for SYSLINUX Win32
17 # This is separated out mostly so we can have a different set of Makefile
21 OSTYPE
= $(shell uname
-msr
)
22 ifeq ($(findstring CYGWIN
,$(OSTYPE
)),CYGWIN
)
23 ## Compiling on Cygwin
25 WINCFLAGS
:= -mno-cygwin
$(GCCWARN
) -Os
-fomit-frame-pointer
-D_FILE_OFFSET_BITS
=64
26 WINLDFLAGS
:= -mno-cygwin
-Os
-s
28 ## Compiling on some variant of MinGW
29 ifeq ($(findstring MINGW32
,$(OSTYPE
)),MINGW32
)
32 WINPREFIX
:= $(shell .
/find-mingw32.sh gcc
)
34 WINCFLAGS
:= $(GCCWARN
) -Wno-sign-compare
-Os
-fomit-frame-pointer \
35 -D_FILE_OFFSET_BITS
=64
38 WINCFLAGS
+= -I.
-I..
/win
-I..
-I..
/libfat
-I..
/libinstaller \
39 -I..
/libinstaller
/getopt
41 WINCC
:= $(WINPREFIX
)gcc
42 WINAR
:= $(WINPREFIX
)ar
43 WINRANLIB
:= $(WINPREFIX
)ranlib
45 WINCC_IS_GOOD
:= $(shell $(WINCC
) $(WINCFLAGS
) $(WINLDFLAGS
) \
46 -o hello.exe ..
/win
/hello.c
>/dev
/null
2>&1 ; echo
$$?
)
48 .SUFFIXES
: .c .obj .lib .exe .i .s .S
50 SRCS
= ..
/win
/syslinux.c ..
/win
/ntfssect.c
51 OBJS
= $(patsubst %.c
,%.obj
,$(notdir $(SRCS
)))
52 LIBSRC
= ..
/libinstaller
/fs.c \
53 ..
/libinstaller
/syslxmod.c \
54 ..
/libinstaller
/syslxopt.c \
55 ..
/libinstaller
/setadv.c \
56 ..
/libinstaller
/getopt
/getopt_long.c \
57 ..
/libinstaller
/bootsect_bin.c \
58 ..
/libinstaller
/ldlinux_bin.c \
59 ..
/libinstaller
/ldlinuxc32_bin.c \
60 ..
/libinstaller
/mbr_bin.c \
61 $(wildcard ..
/libfat
/*.c
)
62 LIBOBJS
= $(patsubst %.c
,%.obj
,$(notdir $(LIBSRC
)))
66 VPATH
= .
:..
/win
:..
/libfat
:..
/libinstaller
:..
/libinstaller
/getopt
68 TARGETS
= syslinux.exe
70 ifeq ($(WINCC_IS_GOOD
),0)
78 -rm -f
*.o
*.obj
*.lib
*.i
*.s
*.a .
*.d
*.tmp
*_bin.c hello.exe
92 syslinux.exe
: $(OBJS
) $(LIB
)
93 $(WINCC
) $(WINLDFLAGS
) -o
$@
$^
97 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -c
-o
$@
$<
99 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -E
-o
$@
$<
101 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -S
-o
$@
$<