summaryrefslogtreecommitdiffstats
path: root/src/util/profile/Makefile.in
blob: f1418fb7fe8bf58d91d0a7a1971f9e01169c29c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
mydir=util$(S)profile
BUILDTOP=$(REL)..$(S)..
SUBDIRS=testmod
PROG_LIBPATH=-L$(TOPLIBD) $(TCL_LIBPATH) -L.
PROG_RPATH=$(KRB5_LIBDIR)$(TCL_RPATH)
##DOS##BUILDTOP = ..\..
##DOS##OBJFILE=$(OUTPRE)profile.lst
##DOS##LIBNAME=$(OUTPRE)profile.lib

LOCALINCLUDES=-I. $(TCL_INCLUDES)
# for tcl.h
DEFINES=-DHAS_STDARG -DLIBDIR=\"$(KRB5_LIBDIR)\"

STLIBOBJS = \
	prof_tree.o \
	prof_file.o \
	prof_parse.o \
	prof_get.o \
	prof_set.o \
	prof_err.o \
	prof_init.o

OBJS = $(OUTPRE)prof_tree.$(OBJEXT) \
	$(OUTPRE)prof_file.$(OBJEXT) \
	$(OUTPRE)prof_parse.$(OBJEXT) \
	$(OUTPRE)prof_get.$(OBJEXT) \
	$(OUTPRE)prof_set.$(OBJEXT) \
	$(OUTPRE)prof_err.$(OBJEXT) \
	$(OUTPRE)prof_init.$(OBJEXT)

SRCS = $(srcdir)/prof_tree.c \
	$(srcdir)/prof_file.c \
	$(srcdir)/prof_parse.c \
	$(srcdir)/prof_get.c \
	$(srcdir)/prof_set.c \
	prof_err.c \
	$(srcdir)/prof_init.c

EXTRADEPSRCS=$(srcdir)/test_load.c $(srcdir)/test_parse.c \
	$(srcdir)/test_profile.c $(srcdir)/test_vtable.c \
	$(srcdir)/profile_tcl.c

DEPLIBS = $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
MLIBS = -lcom_err $(SUPPORT_LIB) $(LIBS)

LIBBASE=profile
LIBMAJOR=1
LIBMINOR=1
SHLIB_EXPDEPS = $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
SHLIB_EXPLIBS = -lcom_err $(SUPPORT_LIB) $(LIBS)

PROFILE_HDR=$(BUILDTOP)$(S)include$(S)profile.h

all-unix:: includes 
all-unix:: all-libs
all-windows:: $(PROFILE_HDR)

install-headers-unix:: includes

generate-files-mac: profile.h

$(PROFILE_HDR):: profile.h
	$(CP) profile.h "$@"

includes:: profile.h
	if cmp profile.h \
	$(BUILDTOP)/include/profile.h >/dev/null 2>&1; then :; \
	else \
		(set -x; $(RM) $(BUILDTOP)/include/profile.h; \
		 $(CP) profile.h $(BUILDTOP)/include/profile.h) ; \
	fi

clean-unix::
	$(RM) $(BUILDTOP)/include/profile.h test2.ini test3.ini test2.ini.bak

##DOS##LIBOBJS = $(OBJS)


awk-windows:
	$(AWK) -f $(BUILDTOP)/util/et/et_h.awk outfile=prof_err.h prof_err.et
	$(AWK) -f $(BUILDTOP)/util/et/et_c.awk outfile=prof_err.c prof_err.et
	if exist prof_err.h copy profile.hin+prof_err.h profile.h
	if exist profile.h copy profile.h $(BUILDTOP)\include\profile.h

test_parse: test_parse.$(OBJEXT) $(OBJS) $(DEPLIBS)
	$(CC_LINK) -o test_parse test_parse.$(OBJEXT) $(OBJS) $(MLIBS)

test_profile: test_profile.$(OBJEXT) argv_parse.$(OBJEXT) $(OBJS) $(DEPLIBS)
	$(CC_LINK) -o test_profile test_profile.$(OBJEXT) \
		argv_parse.$(OBJEXT) $(OBJS) $(MLIBS)

test_vtable: test_vtable.$(OBJEXT) $(OBJS) $(DEPLIBS)
	$(CC_LINK) -o test_vtable test_vtable.$(OBJEXT) $(OBJS) $(MLIBS)

test_load: test_load.$(OBJEXT) $(OBJS) $(DEPLIBS)
	$(CC_LINK) -o test_load test_load.$(OBJEXT) $(OBJS) $(MLIBS)

modtest.conf:
	echo "module `pwd`/testmod/proftest$(DYNOBJEXT):teststring" > $@

.d: includes

# NEED TO FIX!!
$(OUTPRE)test_parse.exe: 
	$(CC) $(CFLAGS2) -o test_parse.exe test_parse.c \
		prof_parse.c prof_tree.c /link /stack:16384

# NEED TO FIX!!
$(OUTPRE)test_profile.exe: 
	$(CC) $(CFLAGS2) -o test_profile.exe test_profile.c prof_init.c \
		prof_file.c prof_parse.c prof_tree.c /link /stack:16384

##DOS##!if 0
profile.h: prof_err.h profile.hin
	cat $(srcdir)/profile.hin prof_err.h > $@
##DOS##!endif
##DOS##profile.h: prof_err.h profile.hin
##DOS##	copy /b profile.hin+prof_err.h $@

prof_err.h: $(srcdir)/prof_err.et

prof_err.c: $(srcdir)/prof_err.et

prof_err.o: prof_err.c

# not built by default, but may be useful for testing
$(srcdir)/profile_tcl.c: profile.swg
#	(cd $(srcdir) && swig -tcl8 -nosafe -o profile_tcl.c profile.swg)
profile_tcl.o: $(srcdir)/profile_tcl.c profile.h
profile_tcl: profile_tcl.o $(PROF_DEPLIB) $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
	$(CC_LINK) -o profile_tcl profile_tcl.o \
		$(TCL_MAYBE_RPATH) \
		-L../et -L../.. -lprofile $(TCL_LIBS) $(MLIBS)

clean-unix:: clean-libs clean-libobjs
	$(RM) $(PROGS) *.o *~ core prof_err.h profile.h prof_err.c
	$(RM) test_load test_parse test_profile test_vtable profile_tcl
	$(RM) modtest.conf testinc.ini testinc2.ini
	$(RM) -r test_include_dir

clean-windows::
	$(RM) $(PROFILE_HDR)

check-unix:: test_parse test_profile test_vtable test_load modtest.conf
	$(RUN_SETUP) $(VALGRIND) ./test_vtable
	$(RUN_SETUP) $(VALGRIND) ./test_load

DO_TCL=@DO_TCL@
check-unix:: check-unix-tcl-$(DO_TCL)

check-unix-tcl-:
	@echo "+++"
	@echo "+++ Tcl not available, some profile tests not run."
	@echo "+++"

check-unix-tcl-ok: profile_tcl
	cp $(srcdir)/test.ini test2.ini
	$(RUN_SETUP) $(VALGRIND) ./profile_tcl $(srcdir)/prof_test1

check-windows:: $(OUTPRE)test_profile.exe $(OUTPRE)test_parse.exe
	$(RM) $(OUTPRE)*.obj
	$(OUTPRE)test_parse test.ini


@lib_frag@
@libobj_frag@