Refactor EGD conditional support
[heimdal.git] / include / NTMakefile
blob984984d4a29cb8cfc8f6795ffa2a24c2ee605004
1 ########################################################################
3 # Copyright (c) 2009, Secure Endpoints Inc.
4 # All rights reserved.
5
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9
10 # - Redistributions of source code must retain the above copyright
11 #   notice, this list of conditions and the following disclaimer.
12
13 # - Redistributions in binary form must reproduce the above copyright
14 #   notice, this list of conditions and the following disclaimer in
15 #   the documentation and/or other materials provided with the
16 #   distribution.
17
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
30
32 RELDIR=include
34 SUBDIRS=kadm5 hcrypto gssapi
36 !include ../windows/NTMakefile.w32
37 !include ../windows/NTMakefile.version
38 !include ../windows/NTMakefile.config
40 INCFILES=                       \
41         $(INCDIR)\config.h      \
42         $(INCDIR)\crypto-headers.h      \
43         $(INCDIR)\heim_threads.h        \
44         $(INCDIR)\krb5-types.h  \
45         $(INCDIR)\version.h
47 $(INCDIR)\krb5-types.h: $(OBJ)\bits.exe
48         $(OBJ)\bits.exe $(INCDIR)\krb5-types.h
50 $(OBJ)\bits.exe: $(OBJ)\bits.obj
51         $(EXECONLINK)
52         $(EXEPREP_NODIST)
54 $(INCDIR)\config.h: config.h.w32 ..\windows\NTMakefile.config ..\windows\NTMakefile.version NTMakefile
55         $(PERL) << < config.h.w32 > $@
57 while(<>) {
59   if (m/\@FEATURE_DEFS\@/) {
61     if ("$(KRB5)") { print "#define KRB5 1\n"; }
62     if ("$(KRB4)") { print "#define KRB4 1\n"; }
63     if ("$(WEAK_CRYPTO)") { print "#define HEIM_WEAK_CRYPTO 1\n"; }
64     if ("$(PKINIT)") { print "#define PKINIT 1\n"; }
65     if ("$(NO_AFS)") { print "#define NO_AFS 1\n"; }
66     if ("$(OPENLDAP)") { print "#define OPENLDAP 1\n"; }
67     if ("$(OPENLDAP_MODULE)") { print "#define OPENLDAP_MODULE 1\n"; }
68     if ("$(OTP)") { print "#define OTP 1 \n"; }
69     if ("$(AUTHENTICATION)") { print "#define AUTHENTICATION 1\n"; }
70     if ("$(DIAGNOSTICS)") { print "#define DIAGNOSTICS 1\n"; }
71     if ("$(ENCRYPTION)") { print "#define ENCRYPTION 1\n"; }
72     if ("$(ENABLE_AFS_STRING_TO_KEY)") { print "#define ENABLE_AFS_STRING_TO_KEY 1\n"; }
73     if ("$(ENABLE_PTHREAD_SUPPORT)") { print "#define ENABLE_PTHREAD_SUPPORT 1\n"; }
74     if ("$(HAVE_PTHREAD_H)") { print "#define HAVE_PTHREAD_H 1\n"; }
75     if ("$(ENV_HACK)") { print "#define ENV_HACK 1\n"; }
76     if ("$(HAVE_KCM)") { print "#define HAVE_KCM 1\n"; }
77     if ("$(HAVE_SCC)") { print "#define HAVE_SCC 1\n"; }
78     if ("$(HAVE_STDINT_H)") { print "#define HAVE_STDINT_H 1\n"; }
79     if ("$(DIR_hdbdir)") { print "#define HDB_DB_DIR \"".'$(DIR_hdbdir)'."\"\n"; }
80     if ("$(HAVE_MSLSA_CACHE)") { print "#define HAVE_MSLSA_CACHE 1\n"; }
81     if ("$(NO_LOCALNAME)") { print "#define NO_LOCALNAME 1\n"; }
83   } elsif (m/\@VERSION_OPTDEFS\@/) {
85     if ("$(VER_PRERELEASE)") { print "#define VER_PRERELEASE 1\n"; }
86     if ("$(VER_PRIVATE)") { print "#define VER_PRIVATE \"$(VER_PRIVATE)\"\n"; }
87     if ("$(VER_SPECIAL)") { print "#define VER_SPECIAL \"$(VER_SPECIAL)\"\n"; }
88     if ("$(BUILD)" eq "dbg") { print "#define VER_DEBUG 1\n"; }
89     print "#define HOST \"$(COMPUTERNAME)\"\n";
91   } else {
93     s/\@PACKAGE\@/$(VER_PACKAGE)/;
94     s/\@PACKAGE_NAME\@/$(VER_PACKAGE_NAME)/;
95     s/\@PACKAGE_BUGREPORT\@/$(VER_PACKAGE_BUGREPORT:@=\@)/;
96     s/\@PACKAGE_VERSION\@/$(VER_PACKAGE_VERSION)/;
97     s/\@PACKAGE_COPYRIGHT\@/$(VER_PACKAGE_COPYRIGHT)/;
98     s/\@PACKAGE_COMPANY\@/$(VER_PACKAGE_COMPANY)/;
99     s/\@MAJOR\@/$(VER_PRODUCT_MAJOR)/;
100     s/\@MINOR\@/$(VER_PRODUCT_MINOR)/;
101     s/\@AUX\@/$(VER_PRODUCT_AUX)/;
102     s/\@PATCH\@/$(VER_PRODUCT_PATCH)/;
104     print $_;
105   }
110 $(INCDIR)\version.h: ..\windows\NTMakefile.version NTMakefile
111         $(CP) << $@
112 const char *heimdal_long_version = "@(#)$$Version: $(VER_PACKAGE_NAME) $(VER_PACKAGE_VERSION) by $(USERNAME) on $(COMPUTERNAME) ($(CPU)-pc-windows) $$";
113 const char *heimdal_version = "$(VER_PACKAGE_NAME) $(VER_PACKAGE_VERSION)";
116 all:: $(INCFILES)
118 clean::
119         -$(RM) $(INCFILES)