1 ## $Id: Makefile,v 1.12 2004/12/22 17:53:54 hpa Exp $
2 ## -----------------------------------------------------------------------
4 ## Copyright 1998-2004 H. Peter Anvin - All Rights Reserved
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)
26 CFLAGS = -mno-cygwin -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
28 LDFLAGS = -mno-cygwin -Os -s
30 ifeq ($(findstring MINGW32,$(OSTYPE)),MINGW32)
40 CFLAGS = -W -Wall -Wno-sign-compare -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
44 CFLAGS += -I. -I.. -I../libfat
46 CC_IS_GOOD := $(shell $(CC) $(CFLAGS) $(LDFLAGS) -o hello.exe hello.c >/dev/null 2>&1 ; echo $$?)
48 .SUFFIXES: .c .o .i .s .S
50 SRCS = syslinux.c ../syslxmod.c ../bootsect_bin.c ../ldlinux_bin.c \
51 ../mbr_bin.c $(wildcard ../libfat/*.c)
52 OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
54 VPATH = .:..:../libfat
56 TARGETS = syslinux.exe
58 ifeq ($(CC_IS_GOOD),0)
66 -rm -f *.o *.i *.s *.a .*.d *_bin.c
76 $(CC) $(LDFLAGS) -o $@ $^
80 $(CC) -Wp,-MT,$@,-MMD,.$@.d $(CFLAGS) -c -o $@ $<
82 $(CC) $(CFLAGS) -E -o $@ $<
84 $(CC) $(CFLAGS) -S -o $@ $<