1 ## -----------------------------------------------------------------------
3 ## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
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.
11 ## -----------------------------------------------------------------------
14 # Makefile for SYSLINUX Win32
16 # This is separated out mostly so we can have a different set of Makefile
20 OSTYPE
= $(shell uname
-msr
)
21 ifeq ($(findstring CYGWIN
,$(OSTYPE
)),CYGWIN
)
22 ## Compiling on Cygwin
24 WINCFLAGS
:= -mno-cygwin
$(GCCWARN
) -Os
-fomit-frame-pointer
-D_FILE_OFFSET_BITS
=64
25 WINLDFLAGS
:= -mno-cygwin
-Os
-s
27 ## Compiling on some variant of MinGW
28 ifeq ($(findstring MINGW32
,$(OSTYPE
)),MINGW32
)
31 WINPREFIX
:= $(shell .
/find-mingw.sh gcc
)
33 WINCFLAGS
:= $(GCCWARN
) -Wno-sign-compare
-Os
-fomit-frame-pointer \
34 -D_FILE_OFFSET_BITS
=64
37 WINCFLAGS
+= -I.
-I..
-I..
/libfat
-I..
/libinstaller
39 WINCC
:= $(WINPREFIX
)gcc
40 WINAR
:= $(WINPREFIX
)ar
41 WINRANLIB
:= $(WINPREFIX
)ranlib
43 WINCC_IS_GOOD
:= $(shell $(WINCC
) $(WINCFLAGS
) $(WINLDFLAGS
) -o hello.exe hello.c
>/dev
/null
2>&1 ; echo
$$?
)
45 .SUFFIXES
: .c .o .i .s .S
48 ..
/libinstaller
/fat.c \
49 ..
/libinstaller
/syslxmod.c \
50 ..
/libinstaller
/bootsect_bin.c \
51 ..
/libinstaller
/ldlinux_bin.c \
52 ..
/libinstaller
/mbr_bin.c \
53 $(wildcard ..
/libfat
/*.c
)
54 OBJS
= $(patsubst %.c
,%.o
,$(notdir $(SRCS
)))
56 VPATH
= .
:..
/libfat
:..
/libinstaller
58 TARGETS
= syslinux.exe
60 ifeq ($(WINCC_IS_GOOD
),0)
68 -rm -f
*.o
*.i
*.s
*.a .
*.d
*.tmp
*_bin.c hello.exe
78 $(WINCC
) $(WINLDFLAGS
) -o
$@
$^
82 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -c
-o
$@
$<
84 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -E
-o
$@
$<
86 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -S
-o
$@
$<