Adding upstream version 3.30~pre4.
[syslinux-debian/hramrach.git] / win32 / Makefile
blobb83a91eccd6b06b04a366d2e81fb719759b34ad8
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 1998-2004 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.
11 ## -----------------------------------------------------------------------
14 # Makefile for SYSLINUX Win32
16 # This is separated out mostly so we can have a different set of Makefile
17 # variables.
20 OSTYPE = $(shell uname -msr)
21 ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN)
22 CC = gcc
23 AR = ar
24 RANLIB = ranlib
25 CFLAGS = -mno-cygwin -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
26 PIC =
27 LDFLAGS = -mno-cygwin -Os -s
28 else
29 ifeq ($(findstring MINGW32,$(OSTYPE)),MINGW32)
30 CC = gcc
31 AR = ar
32 RANLIB = ranlib
33 else
34 CC = mingw-gcc
35 AR = mingw-ar
36 RANLIB = mingw-ranlib
37 endif
39 CFLAGS = -W -Wall -Wno-sign-compare -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
40 PIC =
41 LDFLAGS = -Os -s
42 endif
43 CFLAGS += -I. -I.. -I../libfat
45 CC_IS_GOOD := $(shell $(CC) $(CFLAGS) $(LDFLAGS) -o hello.exe hello.c >/dev/null 2>&1 ; echo $$?)
47 .SUFFIXES: .c .o .i .s .S
49 SRCS = syslinux.c ../syslxmod.c ../bootsect_bin.c ../ldlinux_bin.c \
50 ../mbr_bin.c $(wildcard ../libfat/*.c)
51 OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
53 VPATH = .:..:../libfat
55 TARGETS = syslinux.exe
57 ifeq ($(CC_IS_GOOD),0)
58 all: $(TARGETS)
59 else
60 all:
61 rm -f $(TARGETS)
62 endif
64 tidy:
65 -rm -f *.o *.i *.s *.a .*.d *_bin.c
67 clean: tidy
69 spotless: clean
70 -rm -f *~ $(TARGETS)
72 installer:
74 syslinux.exe: $(OBJS)
75 $(CC) $(LDFLAGS) -o $@ $^
78 %.o: %.c
79 $(CC) -Wp,-MT,$@,-MMD,.$@.d $(CFLAGS) -c -o $@ $<
80 %.i: %.c
81 $(CC) $(CFLAGS) -E -o $@ $<
82 %.s: %.c
83 $(CC) $(CFLAGS) -S -o $@ $<
85 -include .*.d