Windows: pSrcObject instead of pSrcFcb->ObjectInformation
[openafs.git] / src / WINNT / afsrdr / NTMakefile
1 # Copyright (c) 2008, 2009, 2010, 2011 Kernel Drivers, LLC.
2 # Copyright (c) 2009, 2010, 2011 Your File System, Inc.
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
8 #
9 # - Redistributions of source code must retain the above copyright notice,
10 #   this list of conditions and the following disclaimer.
11 # - Redistributions in binary form must reproduce the above copyright
12 #   notice,
13 #   this list of conditions and the following disclaimer in the
14 #   documentation
15 #   and/or other materials provided with the distribution.
16 # - Neither the names of Kernel Drivers, LLC and Your File System, Inc.
17 #   nor the names of their contributors may be used to endorse or promote
18 #   products derived from this software without specific prior written
19 #   permission from Kernel Drivers, LLC and Your File System, Inc.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24 # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25 # OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33
34 # This file requires Microsoft Windows DDK/WDK 6001 or higher
35
36 !IF ("$(CPU)" == "x86")
37 CPU = i386
38 !ENDIF
39
40 RELDIR=WINNT\afsrdr
41 !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
42 !INCLUDE ..\..\config\NTMakefile.version
43
44 TARGETPATH = $(DESTDIR)\root.client\usr\vice\etc
45
46 !IF ("$(CPU)" == "i386")
47 DDK_ARCH=X86
48 DDK_PLATFORM=WXP
49 !ELSE IF ("$(CPU)" == "AMD64")
50 DDK_ARCH=x64
51 DDK_PLATFORM=WNET
52 !ENDIF
53
54 !IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
55 DDK_BUILDTYPE=FRE
56 !ELSE
57 DDK_BUILDTYPE=CHK
58 !ENDIF
59
60 !IF ("$(_RunOacr)" == "TRUE")
61 OACR = oacr
62 !ELSE
63 OACR = no_oacr
64 !ENDIF
65
66 $(OUT)\ddkbuild.cmd: NTMakefile
67         echo CALL "$(NTDDKDIR)\bin\setenv.bat" $(NTDDKDIR) $(DDK_ARCH) $(DDK_PLATFORM) $(DDK_BUILDTYPE) $(OACR) > $@
68         echo cd /d $(AFSROOT)\src\WINNT\afsrdr >> $@
69         echo cd kernel\fs >> $@
70         echo build.exe -M >> $@
71         echo if errorlevel neq 0 exit 1 >> $@
72         echo cd ..\..\kernel\lib >> $@
73         echo build.exe -M >> $@
74         echo if errorlevel neq 0 exit 1 >> $@
75         echo cd ..\..\npdll >> $@
76         echo build.exe -M >> $@
77         echo if errorlevel neq 0 exit 1 >> $@
78         echo cd ..\build\$(CPU) >> $@
79 !IFDEF CODESIGN_KERNEL
80         echo $(CODESIGN_KERNEL) AFSRedir.sys >> $@
81         echo $(CODESIGN_KERNEL) AFSRedirLib.sys >> $@
82 !ENDIF
83 !IFDEF CODESIGN_USERLAND
84         echo $(CODESIGN_USERLAND) AFSRDFSProvider.dll >> $@
85 !ENDIF
86 !IFDEF SYMSTORE_EXE
87 !IFDEF SYMSTORE_ROOT
88         echo $(SYMSTORE_EXE) add /s $(SYMSTORE_ROOT) /t "OpenAFS for Windows" /v "$(AFSBLD_TYPE)-$(CPU)-$(AFSPRODUCT_VERSION)" /c "AFSRedir.sys$(SYMSTORE_COMMENT)" /f AFSRedir.* >> $@
89         echo $(SYMSTORE_EXE) add /s $(SYMSTORE_ROOT) /t "OpenAFS for Windows" /v "$(AFSBLD_TYPE)-$(CPU)-$(AFSPRODUCT_VERSION)" /c "AFSRedirLib.sys$(SYMSTORE_COMMENT)" /f AFSRedirLib.* >> $@
90         echo $(SYMSTORE_EXE) add /s $(SYMSTORE_ROOT) /t "OpenAFS for Windows" /v "$(AFSBLD_TYPE)-$(CPU)-$(AFSPRODUCT_VERSION)" /c "AFSRDFSProvider.dll$(SYMSTORE_COMMENT)" /f AFSRDRFSProvider.* >> $@
91 !ENDIF
92 !ENDIF
93         echo exit 0 >> $@
94
95 $(OUT)\ddkclean.cmd: NTMakefile
96         echo CALL "$(NTDDKDIR)\bin\setenv.bat" $(NTDDKDIR) $(DDK_ARCH) $(DDK_PLATFORM) $(DDK_BUILDTYPE) $(OACR) > $@
97         echo cd /d $(AFSROOT)\src\WINNT\afsrdr >> $@
98         echo cd kernel\fs >> $@
99         echo build.exe -c -0 >> $@
100         echo cd ..\lib >> $@
101         echo build.exe -c -0 >> $@
102         echo cd ..\..\npdll >> $@
103         echo build.exe -c -0 >> $@
104         echo exit 0 >> $@
105
106 install: clean-build clean-kernel-fs clean-kernel-lib clean-npdll \
107          AFS_component_version_number.h $(OUT)\ddkbuild.cmd $(OUT)\ddkclean.cmd \
108          kernel\fs\AFSRedirInstall.inf \
109          kernel\lib\AFSRedirLibInstall.inf
110 !IF !EXIST(build\$(CPU))
111         $(MKDIR) build\$(CPU)
112 !ENDIF
113         cd tools\gettrace
114         $(MAKE) -f ntmakefile install
115         cd ..\settrace
116         $(MAKE) -f ntmakefile install
117         cd ..\crash
118         $(MAKE) -f ntmakefile install
119         cd ..\authgroup
120         $(MAKE) -f ntmakefile install
121         cd ..\objstatus
122         $(MAKE) -f ntmakefile install
123         cd ..\..
124         type $(OUT)\ddkbuild.cmd
125         -$(DEL) build\$(CPU)\AFSRedir.sys
126         -$(DEL) build\$(CPU)\AFSRedirLib.sys
127         -$(DEL) build\$(CPU)\AFSRDFSProvider.dll
128         cmd /c start /wait $(OUT)\ddkbuild.cmd
129         cmd /c if not exist build\$(CPU)\AFSRedir.sys exit 1
130         cmd /c if not exist build\$(CPU)\AFSRedirLib.sys exit 1
131         cmd /c if not exist build\$(CPU)\AFSRDFSProvider.dll exit 1
132         $(COPY) kernel\fs\AFSRedirInstall.inf build\$(CPU)\AFSRedirInstall.inf
133         $(COPY) kernel\lib\AFSRedirLibInstall.inf build\$(CPU)\AFSRedirLibInstall.inf
134         $(COPY) build\$(CPU)\* $(TARGETPATH)
135
136 clean-build:
137 !IF EXIST(build\$(CPU))
138         cd build\$(CPU)
139         -$(DEL) *.sys
140         -$(DEL) *.exe
141         -$(DEL) *.dll
142         -$(DEL) *.pdb
143         -$(DEL) *.inf
144         -$(DEL) *.manifest
145          cd ..\..
146 !ENDIF
147
148 clean-kernel-fs:
149         cd kernel\fs
150         -$(DEL) *.log
151         -$(DEL) *.wrn
152         -$(DEL) *.aps
153         -$(DEL) *.suo
154         cd ..\..
155
156 clean-kernel-lib:
157         cd kernel\lib
158         -$(DEL) *.log
159         -$(DEL) *.wrn
160         -$(DEL) *.aps
161         -$(DEL) *.suo
162         cd ..\..
163
164 clean-npdll:
165         cd npdll
166         -$(DEL) *.log
167         -$(DEL) *.wrn
168         -$(DEL) *.aps
169         -$(DEL) *.suo
170         cd ..
171
172 clean:: clean-build clean-kernel-fs clean-kernel-lib clean-npdll
173         -$(DEL) $(OUT)\ddkbuild.cmd
174         -type $(OUT)\ddkclean.cmd
175         if exist $(OUT)\ddkclean.cmd start /wait $(OUT)\ddkclean.cmd
176         -$(DEL) $(OUT)\ddkclean.cmd
177         -$(DEL) AFS_component_version_number.h
178         cd tools/gettrace
179         $(MAKE) -f ntmakefile clean
180         cd ../settrace
181         $(MAKE) -f ntmakefile clean
182         cd ../authgroup
183         $(MAKE) -f ntmakefile clean
184         cd ../objstatus
185         $(MAKE) -f ntmakefile clean
186         cd ../crash
187         $(MAKE) -f ntmakefile clean
188         cd ../..