xref: /freebsd/crypto/krb5/src/config/win-post.in (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert#
2*7f2fe78bSCy Schubert# Start of Win32 post-config lines (config/win-post.in)
3*7f2fe78bSCy Schubert#
4*7f2fe78bSCy Schubert
5*7f2fe78bSCy Schubertsetup-msg:
6*7f2fe78bSCy Schubert	@set C_RULE_PRINT=	$(C_RULE_PRINT)
7*7f2fe78bSCy Schubert	@set DO_C_RULE_PRINT=1
8*7f2fe78bSCy Schubert
9*7f2fe78bSCy Schubert!if defined(NO_OUTPRE) || defined(NO_OUTDIR)
10*7f2fe78bSCy Schubertoutpre-dir:
11*7f2fe78bSCy Schubert!else
12*7f2fe78bSCy Schubertoutpre-dir: $(OUTPRE3)$(DIRNUL)
13*7f2fe78bSCy Schubert!endif
14*7f2fe78bSCy Schubert
15*7f2fe78bSCy Schubert#
16*7f2fe78bSCy Schubert# put all: first just in case no other rules occur here
17*7f2fe78bSCy Schubert#
18*7f2fe78bSCy Schubertall:
19*7f2fe78bSCy Schubert
20*7f2fe78bSCy Schubert#
21*7f2fe78bSCy Schubert# Set the #define to indicate that we are compiling a DLL.  We default to
22*7f2fe78bSCy Schubert# compiling the Kerberos library
23*7f2fe78bSCy Schubert#
24*7f2fe78bSCy Schubert!if defined(DLL_EXP_TYPE)
25*7f2fe78bSCy SchubertDLL_FILE_DEF=/D$(DLL_EXP_TYPE)_DLL_FILE
26*7f2fe78bSCy Schubert!else
27*7f2fe78bSCy SchubertDLL_FILE_DEF=/DKRB5_DLL_FILE
28*7f2fe78bSCy Schubert!endif
29*7f2fe78bSCy Schubert
30*7f2fe78bSCy Schubert# Build the Makefile unless we are in the top-level
31*7f2fe78bSCy Schubert#(where there is already an explicit rule).
32*7f2fe78bSCy Schubert!if !defined(TOPLEVEL)
33*7f2fe78bSCy SchubertMakefile: Makefile.in $(BUILDTOP)\config\win-pre.in $(BUILDTOP)\config\win-post.in
34*7f2fe78bSCy Schubert	$(WCONFIG) $(BUILDTOP)\config < Makefile.in > Makefile
35*7f2fe78bSCy Schubert!endif
36*7f2fe78bSCy Schubert
37*7f2fe78bSCy Schubert# Recurse into subdirs if WINSUBDIRS or SUBDIRS is defined.  Makefiles
38*7f2fe78bSCy Schubert# can depend on all-recurse, clean-recurse, or check-recurse to perform
39*7f2fe78bSCy Schubert# actions after recursion.
40*7f2fe78bSCy Schubert!if defined(SUBDIRS) && !defined(WINSUBDIRS)
41*7f2fe78bSCy SchubertWINSUBDIRS=$(SUBDIRS)
42*7f2fe78bSCy Schubert!endif
43*7f2fe78bSCy Schubert!ifdef WINSUBDIRS
44*7f2fe78bSCy Schubert
45*7f2fe78bSCy Schubertall-recurse:
46*7f2fe78bSCy Schubert	@for %d in ($(WINSUBDIRS)) do @(echo Making in $(mydir)\%d && \
47*7f2fe78bSCy Schubert		pushd %d && $(MAKE) -$(MFLAGS) && popd) || exit 1
48*7f2fe78bSCy Schubert	@echo Making in $(mydir)
49*7f2fe78bSCy Schubertall-windows: all-recurse
50*7f2fe78bSCy Schubert
51*7f2fe78bSCy Schubertclean-recurse:
52*7f2fe78bSCy Schubert	@for %d in ($(WINSUBDIRS)) do @(echo Making clean in $(mydir)\%d && \
53*7f2fe78bSCy Schubert		pushd %d && $(MAKE) -$(MFLAGS) clean && popd) || exit 1
54*7f2fe78bSCy Schubert	@echo Making clean in $(mydir)
55*7f2fe78bSCy Schubertclean-windows:: clean-recurse
56*7f2fe78bSCy Schubert
57*7f2fe78bSCy Schubertcheck-recurse:
58*7f2fe78bSCy Schubert	@for %d in ($(WINSUBDIRS)) do @(echo Making check in $(mydir)\%d && \
59*7f2fe78bSCy Schubert		pushd %d && $(MAKE) -$(MFLAGS) check && popd) || exit 1
60*7f2fe78bSCy Schubert	@echo Making check in $(mydir)
61*7f2fe78bSCy Schubertcheck-windows: check-recurse
62*7f2fe78bSCy Schubert
63*7f2fe78bSCy Schubert!endif # WINSUBDIRS
64*7f2fe78bSCy Schubert
65*7f2fe78bSCy Schubert# Use 64-bit LIBNAME and OBJFILE on 64-bit platforms, if defined.
66*7f2fe78bSCy Schubert!if ("$(CPU)" == "IA64") || ("$(CPU)" == "AMD64") || ("$(CPU)" == "ALPHA64")
67*7f2fe78bSCy Schubert!if defined(WIN64LIBNAME)
68*7f2fe78bSCy SchubertLIBNAME=$(WIN64LIBNAME)
69*7f2fe78bSCy Schubert!endif
70*7f2fe78bSCy Schubert!if defined(WIN64OBJFILE)
71*7f2fe78bSCy SchubertOBJFILE=$(WIN64OBJFILE)
72*7f2fe78bSCy Schubert!endif
73*7f2fe78bSCy Schubert!endif
74*7f2fe78bSCy Schubert
75*7f2fe78bSCy Schubert# Build a library if LIBNAME is defined.
76*7f2fe78bSCy Schubert!if defined(LIBNAME)
77*7f2fe78bSCy Schubert
78*7f2fe78bSCy Schubert!if !defined(OBJFILELIST)
79*7f2fe78bSCy SchubertOBJFILELIST=@$(OBJFILE)
80*7f2fe78bSCy Schubert!endif
81*7f2fe78bSCy Schubert!if !defined(OBJFILEDEP)
82*7f2fe78bSCy SchubertOBJFILEDEP=$(OBJFILE)
83*7f2fe78bSCy Schubert!endif
84*7f2fe78bSCy Schubert
85*7f2fe78bSCy Schubertall-windows: $(LIBNAME)
86*7f2fe78bSCy Schubert$(LIBNAME): $(OBJFILEDEP)
87*7f2fe78bSCy Schubert	$(LIBCMD) /out:$(LIBNAME) /nologo $(OBJFILELIST)
88*7f2fe78bSCy Schubert
89*7f2fe78bSCy Schubert!endif # LIBNAME
90*7f2fe78bSCy Schubert
91*7f2fe78bSCy Schubert
92*7f2fe78bSCy Schubert# Build an object file list if OBJFILE is defined.
93*7f2fe78bSCy Schubert!if defined(OBJFILE)
94*7f2fe78bSCy Schubertall-windows: $(OBJFILE)
95*7f2fe78bSCy Schubert!if defined(LIBOBJS)
96*7f2fe78bSCy Schubert$(OBJFILE): $(LIBOBJS)
97*7f2fe78bSCy Schubert	if exist $(OBJFILE) del $(OBJFILE)
98*7f2fe78bSCy Schubert!if defined(PREFIXDIR)
99*7f2fe78bSCy Schubert	$(LIBECHO) -p $(PREFIXDIR)\ $** > $(OBJFILE)
100*7f2fe78bSCy Schubert!else
101*7f2fe78bSCy Schubert	$(LIBECHO) $** > $(OBJFILE)
102*7f2fe78bSCy Schubert!endif # !PREFIXDIR
103*7f2fe78bSCy Schubert!endif # LIBOBJS
104*7f2fe78bSCy Schubert!endif # OBJFILE
105*7f2fe78bSCy Schubert
106*7f2fe78bSCy Schubert
107*7f2fe78bSCy Schubertcheck:
108*7f2fe78bSCy Schubertcheck-windows:
109*7f2fe78bSCy Schubert
110*7f2fe78bSCy Schubertclean-windows:: clean-windows-files clean-windows-dir
111*7f2fe78bSCy Schubert
112*7f2fe78bSCy Schubert
113*7f2fe78bSCy Schubert# This needs to be in the post because we need RM to be defined in terms
114*7f2fe78bSCy Schubert# of BUILDTOP
115*7f2fe78bSCy Schubertclean-windows-files:
116*7f2fe78bSCy Schubert!if "$(OUTPRE3)" == ""
117*7f2fe78bSCy Schubert!error ASSERTION FAILURE: OUTPRE3 must be defined!!!
118*7f2fe78bSCy Schubert!endif
119*7f2fe78bSCy Schubert!if "$(OS)" == "Windows_NT"
120*7f2fe78bSCy Schubert	@if exist $(OUTPRE3)$(DIRNUL) rd /s/q $(OUTPRE3)
121*7f2fe78bSCy Schubert!else
122*7f2fe78bSCy Schubert	@if exist $(OUTPRE3)$(DIRNUL) deltree /y $(OUTPRE3)
123*7f2fe78bSCy Schubert!endif
124*7f2fe78bSCy Schubert
125*7f2fe78bSCy Schubert# Dependencies
126*7f2fe78bSCy Schubert!if exist($(srcdir)/deps)
127*7f2fe78bSCy Schubert!include $(srcdir)/deps
128*7f2fe78bSCy Schubert!endif
129