Aligning memcpy/memmove/mempcpy/memset for libcom32
[syslinux.git] / win32 / Makefile
blob9976615118ce466f777677c9fe6c01a707d2626b
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 1998-2008 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 WINCC = gcc
23 WINAR = ar
24 WINRANLIB = ranlib
25 WINCFLAGS = -mno-cygwin -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
26 WINPIC =
27 WINLDFLAGS = -mno-cygwin -Os -s
28 else
29 ifeq ($(findstring MINGW32,$(OSTYPE)),MINGW32)
30 WINCC = gcc
31 WINAR = ar
32 WINRANLIB = ranlib
33 else
34 WINCC = i386-mingw32-gcc
35 WINAR = i386-mingw32-ar
36 WINRANLIB = i386-mingw32-ranlib
37 endif
39 WINCFLAGS = -W -Wall -Wno-sign-compare -Os -fomit-frame-pointer \
40 -D_FILE_OFFSET_BITS=64
41 WINPIC =
42 WINLDFLAGS = -Os -s
43 endif
44 WINCFLAGS += -I. -I.. -I../libfat -I../libinstaller
46 WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) -o hello.exe hello.c >/dev/null 2>&1 ; echo $$?)
48 .SUFFIXES: .c .o .i .s .S
50 SRCS = syslinux.c ../libinstaller/syslxmod.c \
51 ../core/bootsect_bin.c ../core/ldlinux_bin.c \
52 ../mbr/mbr_bin.c $(wildcard ../libfat/*.c)
53 OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
55 VPATH = .:../libfat:../libinstaller:../core:../mbr
57 TARGETS = syslinux.exe
59 ifeq ($(WINCC_IS_GOOD),0)
60 all: $(TARGETS)
61 else
62 all:
63 rm -f $(TARGETS)
64 endif
66 tidy dist:
67 -rm -f *.o *.i *.s *.a .*.d *_bin.c hello.exe
69 clean: tidy
71 spotless: clean
72 -rm -f *~ $(TARGETS)
74 installer:
76 syslinux.exe: $(OBJS)
77 $(WINCC) $(WINLDFLAGS) -o $@ $^
80 %.o: %.c
81 $(WINCC) -Wp,-MT,$@,-MMD,.$@.d $(WINCFLAGS) -c -o $@ $<
82 %.i: %.c
83 $(WINCC) $(WINCFLAGS) -E -o $@ $<
84 %.s: %.c
85 $(WINCC) $(WINCFLAGS) -S -o $@ $<
87 -include .*.d