1 ## -----------------------------------------------------------------------
3 ## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
4 ## Copyright 2010 Intel Corporation; author: H. Peter Anvin
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 Win64 NTFS file cluster test
17 # This is separated out mostly so we can have a different set of Makefile
21 OSTYPE
= $(shell uname
-msr
)
22 # Don't know how to do a native compile here...
23 WINPREFIX
:= $(shell ..
/find-mingw64.sh gcc
)
24 WINCFLAGS
:= $(GCCWARN
) -Wno-sign-compare
-Os
-fomit-frame-pointer \
25 -D_FILE_OFFSET_BITS
=64
27 WINCFLAGS
+= -I.
-I..
/..
/win
29 WINCC
:= $(WINPREFIX
)gcc
30 WINAR
:= $(WINPREFIX
)ar
31 WINRANLIB
:= $(WINPREFIX
)ranlib
32 WINDRES
:= $(WINPREFIX
)windres
34 WINCC_IS_GOOD
:= $(shell $(WINCC
) $(WINCFLAGS
) $(WINLDFLAGS
) \
35 -o hello.exe ..
/..
/win
/hello.c
>/dev
/null
2>&1 ; echo
$$?
)
37 .SUFFIXES
: .c .obj .lib .exe .i .s .S .rc .res
39 SRCS
= ..
/..
/win
/ntfstest.c ..
/..
/win
/ntfssect.c
40 RCS
= ..
/..
/win
/ntfstest.rc
41 OBJS
= $(patsubst %.c
,%.obj
,$(notdir $(SRCS
)))
42 RESS
= $(patsubst %.rc
,%.res
,$(notdir $(RCS
)))
46 TARGETS
= ntfstest64.exe
48 ifeq ($(WINCC_IS_GOOD
),0)
56 -rm -f
*.o
*.obj
*.lib
*.i
*.s
*.a .
*.d
*.tmp
*_bin.c hello.exe
63 ntfstest64.exe
: $(OBJS
) $(RESS
)
64 $(WINCC
) $(WINLDFLAGS
) -o
$@
$^
68 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -c
-o
$@
$<
70 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -E
-o
$@
$<
72 $(WINCC
) $(UMAKEDEPS
) $(WINCFLAGS
) -S
-o
$@
$<
74 $(WINDRES
) -O COFF
$< $@