summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2011-08-14 19:41:24 -0400
committerPaulo Alcantara <pcacjr@gmail.com>2011-09-11 04:09:59 +0000
commit966e23ecf875a0863636e6c5403b0c3ebaa3bdde (patch)
treeed48fad4db93e43ea5a8b8d78dfa75025fed1506 /win32
parent188ec53f750c1ec2e1061755595f0d9fe65ac626 (diff)
downloadsyslinux-966e23ecf875a0863636e6c5403b0c3ebaa3bdde.tar.gz
win: Add further NTFS support to Windows installers
We have a way of building a map of the LDLINUX.SYS sectors on an NTFS filesystem, now. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile2
-rw-r--r--win32/ntfstest/Makefile87
2 files changed, 88 insertions, 1 deletions
diff --git a/win32/Makefile b/win32/Makefile
index cdb18f24..f960998a 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -47,7 +47,7 @@ WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) \
.SUFFIXES: .c .obj .lib .exe .i .s .S
-SRCS = ../win/syslinux.c
+SRCS = ../win/syslinux.c ../win/ntfssect.c
OBJS = $(patsubst %.c,%.obj,$(notdir $(SRCS)))
LIBSRC = ../libinstaller/fs.c \
../libinstaller/syslxmod.c \
diff --git a/win32/ntfstest/Makefile b/win32/ntfstest/Makefile
new file mode 100644
index 00000000..00e89cf9
--- /dev/null
+++ b/win32/ntfstest/Makefile
@@ -0,0 +1,87 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
+## Copyright 2010 Intel Corporation; author: H. Peter Anvin
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+#
+# Makefile for Win32 NTFS file cluster test
+#
+# This is separated out mostly so we can have a different set of Makefile
+# variables.
+#
+
+OSTYPE = $(shell uname -msr)
+ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN)
+## Compiling on Cygwin
+WINPREFIX :=
+WINCFLAGS := -mno-cygwin $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
+WINLDFLAGS := -mno-cygwin -Os -s
+else
+## Compiling on some variant of MinGW
+ifeq ($(findstring MINGW32,$(OSTYPE)),MINGW32)
+WINPREFIX :=
+else
+WINPREFIX := $(shell ../find-mingw32.sh gcc)
+endif
+WINCFLAGS := $(GCCWARN) -Wno-sign-compare -Os -fomit-frame-pointer \
+ -D_FILE_OFFSET_BITS=64
+WINLDFLAGS := -Os -s
+endif
+WINCFLAGS += -I. -I../../win
+
+WINCC := $(WINPREFIX)gcc
+WINAR := $(WINPREFIX)ar
+WINRANLIB := $(WINPREFIX)ranlib
+WINDRES := $(WINPREFIX)windres
+
+WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) \
+ -o hello.exe ../../win/hello.c >/dev/null 2>&1 ; echo $$?)
+
+.SUFFIXES: .c .obj .lib .exe .i .s .S .rc .res
+
+SRCS = ../../win/ntfstest.c ../../win/ntfssect.c
+RCS = ../../win/ntfstest.rc
+OBJS = $(patsubst %.c,%.obj,$(notdir $(SRCS)))
+RESS = $(patsubst %.rc,%.res,$(notdir $(RCS)))
+
+VPATH = .:../../win
+
+TARGETS = ntfstest.exe
+
+ifeq ($(WINCC_IS_GOOD),0)
+all: $(TARGETS)
+else
+all:
+ rm -f $(TARGETS)
+endif
+
+tidy dist:
+ -rm -f *.o *.obj *.lib *.i *.s *.a .*.d *.tmp *_bin.c hello.exe
+
+clean: tidy
+
+spotless: clean
+ -rm -f *~ $(TARGETS)
+
+ntfstest.exe: $(OBJS) $(RESS)
+ $(WINCC) $(WINLDFLAGS) -o $@ $^
+
+
+%.obj: %.c
+ $(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -c -o $@ $<
+%.i: %.c
+ $(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -E -o $@ $<
+%.s: %.c
+ $(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -S -o $@ $<
+%.res: %.rc
+ $(WINDRES) -O COFF $< $@
+
+-include .*.d *.tmp