xref: /freebsd/crypto/krb5/src/util/profile/Makefile.in (revision 9f0f30bc1f5f08d25243952bad3fdc6e13a75c2a)
1mydir=util$(S)profile
2BUILDTOP=$(REL)..$(S)..
3SUBDIRS=testmod
4PROG_LIBPATH=-L$(TOPLIBD) -L.
5##DOS##BUILDTOP = ..\..
6##DOS##OBJFILE=$(OUTPRE)profile.lst
7##DOS##LIBNAME=$(OUTPRE)profile.lib
8
9LOCALINCLUDES=-I.
10DEFINES=-DHAS_STDARG -DLIBDIR=\"$(KRB5_LIBDIR)\"
11
12STLIBOBJS = \
13	prof_tree.o \
14	prof_file.o \
15	prof_parse.o \
16	prof_get.o \
17	prof_set.o \
18	prof_err.o \
19	prof_init.o
20
21OBJS = $(OUTPRE)prof_tree.$(OBJEXT) \
22	$(OUTPRE)prof_file.$(OBJEXT) \
23	$(OUTPRE)prof_parse.$(OBJEXT) \
24	$(OUTPRE)prof_get.$(OBJEXT) \
25	$(OUTPRE)prof_set.$(OBJEXT) \
26	$(OUTPRE)prof_err.$(OBJEXT) \
27	$(OUTPRE)prof_init.$(OBJEXT)
28
29SRCS = $(srcdir)/prof_tree.c \
30	$(srcdir)/prof_file.c \
31	$(srcdir)/prof_parse.c \
32	$(srcdir)/prof_get.c \
33	$(srcdir)/prof_set.c \
34	prof_err.c \
35	$(srcdir)/prof_init.c
36
37EXTRADEPSRCS=$(srcdir)/test_load.c $(srcdir)/test_parse.c \
38	$(srcdir)/test_profile.c $(srcdir)/test_vtable.c $(srcdir)/t_profile.c
39
40DEPLIBS = $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
41MLIBS = $(COM_ERR_LIB) $(SUPPORT_LIB) $(LIBS)
42
43LIBBASE=profile
44LIBMAJOR=1
45LIBMINOR=1
46SHLIB_EXPDEPS = $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
47SHLIB_EXPLIBS = $(COM_ERR_LIB) $(SUPPORT_LIB) $(LIBS)
48
49PROFILE_HDR=$(BUILDTOP)$(S)include$(S)profile.h
50
51all-unix: includes
52all-unix: all-libs
53all-windows: $(PROFILE_HDR)
54
55install-headers-unix: includes
56
57generate-files-mac: profile.h
58
59$(PROFILE_HDR): profile.h
60	$(CP) profile.h "$@"
61
62includes: $(PROFILE_HDR)
63
64clean-unix::
65	$(RM) $(BUILDTOP)/include/profile.h
66
67##DOS##LIBOBJS = $(OBJS)
68
69
70awk-windows:
71	$(AWK) -f $(BUILDTOP)/util/et/et_h.awk outfile=prof_err.h prof_err.et
72	$(AWK) -f $(BUILDTOP)/util/et/et_c.awk outfile=prof_err.c prof_err.et
73	if exist prof_err.h copy profile.hin+prof_err.h profile.h
74	if exist profile.h copy profile.h $(BUILDTOP)\include\profile.h
75
76test_parse: test_parse.$(OBJEXT) $(OBJS) $(DEPLIBS)
77	$(CC_LINK) -o test_parse test_parse.$(OBJEXT) $(OBJS) $(MLIBS)
78
79test_profile: test_profile.$(OBJEXT) argv_parse.$(OBJEXT) $(OBJS) $(DEPLIBS)
80	$(CC_LINK) -o test_profile test_profile.$(OBJEXT) \
81		argv_parse.$(OBJEXT) $(OBJS) $(MLIBS)
82
83test_vtable: test_vtable.$(OBJEXT) $(OBJS) $(DEPLIBS)
84	$(CC_LINK) -o test_vtable test_vtable.$(OBJEXT) $(OBJS) $(MLIBS)
85
86test_load: test_load.$(OBJEXT) $(OBJS) $(DEPLIBS)
87	$(CC_LINK) -o test_load test_load.$(OBJEXT) $(OBJS) $(MLIBS)
88
89t_profile: t_profile.$(OBJEXT) $(OBJS) $(DEPLIBS)
90	$(CC_LINK) -o $@ t_profile.$(OBJEXT) $(OBJS) $(MLIBS)
91
92modtest.conf:
93	echo "module `pwd`/testmod/proftest$(DYNOBJEXT):teststring" > $@
94
95.d: includes
96
97# NEED TO FIX!!
98$(OUTPRE)test_parse.exe:
99	$(CC) $(CFLAGS2) -o test_parse.exe test_parse.c \
100		prof_parse.c prof_tree.c /link /stack:16384
101
102# NEED TO FIX!!
103$(OUTPRE)test_profile.exe:
104	$(CC) $(CFLAGS2) -o test_profile.exe test_profile.c prof_init.c \
105		prof_file.c prof_parse.c prof_tree.c /link /stack:16384
106
107##DOS##!if 0
108profile.h: prof_err.h profile.hin
109	cat $(srcdir)/profile.hin prof_err.h > $@
110##DOS##!endif
111##DOS##profile.h: prof_err.h profile.hin
112##DOS##	copy /b profile.hin+prof_err.h $@
113
114prof_err.h: $(srcdir)/prof_err.et
115
116prof_err.c: $(srcdir)/prof_err.et
117
118prof_err.o: prof_err.c
119
120clean-unix:: clean-libs clean-libobjs
121	$(RM) $(PROGS) *.o *~ core prof_err.h profile.h prof_err.c
122	$(RM) test_load test_parse test_profile test_vtable t_profile
123	$(RM) modtest.conf testinc.ini testinc2.ini final.out test2* test3*
124	$(RM) -r test_include_dir
125
126clean-windows::
127	$(RM) $(PROFILE_HDR)
128
129check-unix: test_parse test_profile modtest.conf
130check-unix: test_vtable test_load t_profile
131	$(RUN_TEST) ./test_vtable
132	$(RUN_TEST) ./test_load
133	cp $(srcdir)/test.ini test2.ini
134	$(RUN_TEST) ./t_profile
135
136check-unix: check-unix-final
137
138F1=$(srcdir)/final1.ini
139F2=$(srcdir)/final2.ini
140F3=$(srcdir)/final3.ini
141F4=$(srcdir)/final4.ini
142F5=$(srcdir)/final5.ini
143QUERY=query section subsection key
144check-unix-final: test_profile
145	$(RM) final.out
146	(echo; $(RUN_TEST) ./test_profile $(F1):$(F1) $(QUERY)) > final.out
147	(echo; $(RUN_TEST) ./test_profile $(F2):$(F1) $(QUERY)) >> final.out
148	(echo; $(RUN_TEST) ./test_profile $(F3):$(F1) $(QUERY)) >> final.out
149	(echo; $(RUN_TEST) ./test_profile $(F4):$(F1) $(QUERY)) >> final.out
150	(echo; $(RUN_TEST) ./test_profile $(F5):$(F1) $(QUERY)) >> final.out
151	cmp final.out $(srcdir)/final.expected
152	$(RM) final.out
153
154check-windows: $(OUTPRE)test_profile.exe $(OUTPRE)test_parse.exe
155	$(RM) $(OUTPRE)*.obj
156	$(OUTPRE)test_parse test.ini
157
158
159@lib_frag@
160@libobj_frag@
161
162