pull up r24469, r24530, r24533, r24534, r24535, r24537 from trunk
[krb5.git] / src / util / profile / Makefile.in
1 mydir=util$(S)profile
2 BUILDTOP=$(REL)..$(S)..
3 PROG_LIBPATH=-L$(TOPLIBD) $(TCL_LIBPATH) -L.
4 PROG_RPATH=$(KRB5_LIBDIR)$(TCL_RPATH)
5 KRB5_RUN_ENV=@KRB5_RUN_ENV@
6 DEFS=
7 ##DOS##BUILDTOP = ..\..
8 ##DOS##OBJFILE=$(OUTPRE)profile.lst
9 ##DOS##LIBNAME=$(OUTPRE)profile.lib
10
11 LOCALINCLUDES=-I. $(TCL_INCLUDES)
12 # for tcl.h
13 DEFINES=-DHAS_STDARG
14
15 STLIBOBJS = \
16         prof_tree.o \
17         prof_file.o \
18         prof_parse.o \
19         prof_get.o \
20         prof_set.o \
21         prof_err.o \
22         prof_init.o
23
24 OBJS = $(OUTPRE)prof_tree.$(OBJEXT) \
25         $(OUTPRE)prof_file.$(OBJEXT) \
26         $(OUTPRE)prof_parse.$(OBJEXT) \
27         $(OUTPRE)prof_get.$(OBJEXT) \
28         $(OUTPRE)prof_set.$(OBJEXT) \
29         $(OUTPRE)prof_err.$(OBJEXT) \
30         $(OUTPRE)prof_init.$(OBJEXT)
31
32 SRCS = $(srcdir)/prof_tree.c \
33         $(srcdir)/prof_file.c \
34         $(srcdir)/prof_parse.c \
35         $(srcdir)/prof_get.c \
36         $(srcdir)/prof_set.c \
37         prof_err.c \
38         $(srcdir)/prof_init.c
39
40 EXTRADEPSRCS=$(srcdir)/test_parse.c $(srcdir)/test_profile.c \
41         $(srcdir)/profile_tcl.c
42
43 DEPLIBS = $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
44 MLIBS = -lcom_err $(SUPPORT_LIB) $(LIBS)
45
46 LIBBASE=profile
47 LIBMAJOR=1
48 LIBMINOR=1
49 SHLIB_EXPDEPS = $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
50 SHLIB_EXPLIBS = -lcom_err $(SUPPORT_LIB) $(LIBS)
51 SHLIB_DIRS = -L$(TOPLIBD)
52 SHLIB_RDIRS=$(KRB5_LIBDIR)
53
54 STOBJLISTS=OBJS.ST
55
56 PROFILE_HDR=$(BUILDTOP)$(S)include$(S)profile.h
57
58 all-unix:: includes 
59 all-unix:: all-libs
60 all-windows:: $(PROFILE_HDR)
61
62 install-headers-unix:: includes
63
64 generate-files-mac: profile.h
65
66 $(PROFILE_HDR):: profile.h
67         $(CP) profile.h "$@"
68
69 includes:: profile.h
70         if cmp profile.h \
71         $(BUILDTOP)/include/profile.h >/dev/null 2>&1; then :; \
72         else \
73                 (set -x; $(RM) $(BUILDTOP)/include/profile.h; \
74                  $(CP) profile.h $(BUILDTOP)/include/profile.h) ; \
75         fi
76
77 clean-unix::
78         $(RM) $(BUILDTOP)/include/profile.h test2.ini test3.ini test2.ini.bak
79
80 ##DOS##LIBOBJS = $(OBJS)
81
82
83 awk-windows:
84         $(AWK) -f $(BUILDTOP)/util/et/et_h.awk outfile=prof_err.h prof_err.et
85         $(AWK) -f $(BUILDTOP)/util/et/et_c.awk outfile=prof_err.c prof_err.et
86         if exist prof_err.h copy profile.hin+prof_err.h profile.h
87         if exist profile.h copy profile.h $(BUILDTOP)\include\profile.h
88
89 test_parse: test_parse.$(OBJEXT) $(OBJS) $(DEPLIBS)
90         $(CC_LINK) -o test_parse test_parse.$(OBJEXT) $(OBJS) $(MLIBS)
91
92 test_profile: test_profile.$(OBJEXT) argv_parse.$(OBJEXT) $(OBJS) $(DEPLIBS)
93         $(CC_LINK) -o test_profile test_profile.$(OBJEXT) \
94                 argv_parse.$(OBJEXT) $(OBJS) $(MLIBS)
95
96 .d: includes
97
98 # NEED TO FIX!!
99 $(OUTPRE)test_parse.exe: 
100         $(CC) $(CFLAGS2) -o test_parse.exe test_parse.c \
101                 prof_parse.c prof_tree.c /link /stack:16384
102
103 # NEED TO FIX!!
104 $(OUTPRE)test_profile.exe: 
105         $(CC) $(CFLAGS2) -o test_profile.exe test_profile.c prof_init.c \
106                 prof_file.c prof_parse.c prof_tree.c /link /stack:16384
107
108 ##DOS##!if 0
109 profile.h: prof_err.h profile.hin
110         cat $(srcdir)/profile.hin prof_err.h > $@
111 ##DOS##!endif
112 ##DOS##profile.h: prof_err.h profile.hin
113 ##DOS## copy /b profile.hin+prof_err.h $@
114
115 prof_err.h: $(srcdir)/prof_err.et
116
117 prof_err.c: $(srcdir)/prof_err.et
118
119 prof_err.o: prof_err.c
120
121 # not built by default, but may be useful for testing
122 $(srcdir)/profile_tcl.c: profile.swg
123 #       (cd $(srcdir) && swig -tcl8 -o profile_tcl.c profile.swg)
124 profile_tcl.o: $(srcdir)/profile_tcl.c profile.h
125 profile_tcl: profile_tcl.o $(PROF_DEPLIB) $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
126         $(CC_LINK) -o profile_tcl profile_tcl.o \
127                 $(TCL_MAYBE_RPATH) \
128                 -L../et -L../.. -lprofile $(TCL_LIBS) $(MLIBS)
129
130 clean-unix:: clean-libs clean-libobjs
131         $(RM) $(PROGS) *.o *~ test_parse core prof_err.h \
132                 prof_err.c test_profile profile.h profile_tcl
133
134 clean-windows::
135         $(RM) $(PROFILE_HDR)
136
137 check-unix:: test_parse test_profile
138
139 DO_TCL=@DO_TCL@
140 check-unix:: check-unix-tcl-$(DO_TCL)
141
142 check-unix-tcl-:
143         @echo "+++"
144         @echo "+++ Tcl not available, some profile tests not run."
145         @echo "+++"
146
147 check-unix-tcl-ok: profile_tcl
148         cp $(srcdir)/test.ini test2.ini
149         $(KRB5_RUN_ENV) $(VALGRIND) ./profile_tcl $(srcdir)/prof_test1
150
151 check-windows:: $(OUTPRE)test_profile.exe $(OUTPRE)test_parse.exe
152         $(RM) $(OUTPRE)*.obj
153         $(OUTPRE)test_parse test.ini
154
155
156 @lib_frag@
157 @libobj_frag@
158