netapi: add NetShareEnum example code.
[gd/samba-autobuild/.git] / source3 / lib / netapi / examples / Makefile.in
1 GTK_FLAGS=`pkg-config gtk+-2.0 --cflags`
2 GTK_LIBS=`pkg-config gtk+-2.0 --libs`
3
4 KRB5LIBS=@KRB5_LIBS@
5 LDAP_LIBS=@LDAP_LIBS@
6 LIBS=@LIBS@ -lnetapi -ltdb -ltalloc
7 DEVELOPER_CFLAGS=@DEVELOPER_CFLAGS@
8 FLAGS=-I../ -L../../../bin @CFLAGS@ $(GTK_FLAGS)
9 CC=@CC@
10 PICFLAG=@PICFLAG@
11 LDFLAGS=@PIE_LDFLAGS@ @LDFLAGS@
12 DYNEXP=@DYNEXP@
13 NETAPI_LIBS=$(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
14 CMDLINE_LIBS=$(NETAPI_LIBS) @POPTLIBS@
15
16 # Compile a source file.
17 COMPILE_CC = $(CC) -I. $(FLAGS) $(PICFLAG) -c $< -o $@
18 COMPILE = $(COMPILE_CC)
19
20 PROGS = bin/getdc@EXEEXT@ \
21         bin/dsgetdc@EXEEXT@ \
22         bin/netdomjoin@EXEEXT@ \
23         bin/netdomjoin-gui@EXEEXT@ \
24         bin/getjoinableous@EXEEXT@ \
25         bin/user_add@EXEEXT@ \
26         bin/user_del@EXEEXT@ \
27         bin/user_enum@EXEEXT@ \
28         bin/user_dispinfo@EXEEXT@ \
29         bin/user_chgpwd@EXEEXT@ \
30         bin/user_getinfo@EXEEXT@ \
31         bin/user_setinfo@EXEEXT@ \
32         bin/user_modalsget@EXEEXT@ \
33         bin/user_modalsset@EXEEXT@ \
34         bin/user_getgroups@EXEEXT@ \
35         bin/group_add@EXEEXT@ \
36         bin/group_del@EXEEXT@ \
37         bin/group_enum@EXEEXT@ \
38         bin/group_setinfo@EXEEXT@ \
39         bin/group_getinfo@EXEEXT@ \
40         bin/group_adduser@EXEEXT@ \
41         bin/group_deluser@EXEEXT@ \
42         bin/group_getusers@EXEEXT@ \
43         bin/localgroup_add@EXEEXT@ \
44         bin/localgroup_del@EXEEXT@ \
45         bin/localgroup_getinfo@EXEEXT@ \
46         bin/localgroup_setinfo@EXEEXT@ \
47         bin/localgroup_enum@EXEEXT@ \
48         bin/localgroup_addmembers@EXEEXT@ \
49         bin/localgroup_delmembers@EXEEXT@ \
50         bin/localgroup_setmembers@EXEEXT@ \
51         bin/localgroup_getmembers@EXEEXT@ \
52         bin/remote_tod@EXEEXT@ \
53         bin/share_add@EXEEXT@ \
54         bin/share_del@EXEEXT@ \
55         bin/share_enum@EXEEXT@
56
57 all: $(PROGS)
58
59 MAKEDIR = || exec false; \
60           if test -d "$$dir"; then :; else \
61           echo mkdir "$$dir"; \
62           mkdir -p "$$dir" >/dev/null 2>&1 || \
63           test -d "$$dir" || \
64           mkdir "$$dir" || \
65           exec false; fi || exec false
66
67 BINARY_PREREQS = bin/.dummy
68
69 bin/.dummy:
70         @if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \
71           dir=bin $(MAKEDIR); fi
72         @: >> $@ || : > $@ # what a fancy emoticon!
73
74 .c.o:
75         @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
76          dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
77         @echo Compiling $*.c
78         @$(COMPILE) && exit 0;\
79                 echo "The following command failed:" 1>&2;\
80                 echo "$(COMPILE_CC)" 1>&2;\
81                 $(COMPILE_CC) >/dev/null 2>&1
82
83 CMDLINE_OBJ = common.o
84 GETDC_OBJ = getdc/getdc.o $(CMDLINE_OBJ)
85 DSGETDC_OBJ = dsgetdc/dsgetdc.o $(CMDLINE_OBJ)
86 NETDOMJOIN_OBJ = netdomjoin/netdomjoin.o $(CMDLINE_OBJ)
87 NETDOMJOIN_GUI_OBJ = netdomjoin-gui/netdomjoin-gui.o
88 GETJOINABLEOUS_OBJ = getjoinableous/getjoinableous.o $(CMDLINE_OBJ)
89 USERADD_OBJ = user/user_add.o $(CMDLINE_OBJ)
90 USERDEL_OBJ = user/user_del.o $(CMDLINE_OBJ)
91 USERENUM_OBJ = user/user_enum.o $(CMDLINE_OBJ)
92 USERDISPINFO_OBJ = user/user_dispinfo.o $(CMDLINE_OBJ)
93 USERCHGPWD_OBJ = user/user_chgpwd.o $(CMDLINE_OBJ)
94 USERGETINFO_OBJ = user/user_getinfo.o $(CMDLINE_OBJ)
95 USERSETINFO_OBJ = user/user_setinfo.o $(CMDLINE_OBJ)
96 USERMODALSGET_OBJ = user/user_modalsget.o $(CMDLINE_OBJ)
97 USERMODALSSET_OBJ = user/user_modalsset.o $(CMDLINE_OBJ)
98 USERGETGROUPS_OBJ = user/user_getgroups.o $(CMDLINE_OBJ)
99 GROUPADD_OBJ = group/group_add.o $(CMDLINE_OBJ)
100 GROUPDEL_OBJ = group/group_del.o $(CMDLINE_OBJ)
101 GROUPENUM_OBJ = group/group_enum.o $(CMDLINE_OBJ)
102 GROUPSETINFO_OBJ = group/group_setinfo.o $(CMDLINE_OBJ)
103 GROUPGETINFO_OBJ = group/group_getinfo.o $(CMDLINE_OBJ)
104 GROUPADDUSER_OBJ = group/group_adduser.o $(CMDLINE_OBJ)
105 GROUPDELUSER_OBJ = group/group_deluser.o $(CMDLINE_OBJ)
106 GROUPGETUSERS_OBJ = group/group_getusers.o $(CMDLINE_OBJ)
107 LOCALGROUPADD_OBJ = localgroup/localgroup_add.o $(CMDLINE_OBJ)
108 LOCALGROUPDEL_OBJ = localgroup/localgroup_del.o $(CMDLINE_OBJ)
109 LOCALGROUPGETINFO_OBJ = localgroup/localgroup_getinfo.o $(CMDLINE_OBJ)
110 LOCALGROUPSETINFO_OBJ = localgroup/localgroup_setinfo.o $(CMDLINE_OBJ)
111 LOCALGROUPENUM_OBJ = localgroup/localgroup_enum.o $(CMDLINE_OBJ)
112 LOCALGROUPADDMEMBERS_OBJ = localgroup/localgroup_addmembers.o $(CMDLINE_OBJ)
113 LOCALGROUPDELMEMBERS_OBJ = localgroup/localgroup_delmembers.o $(CMDLINE_OBJ)
114 LOCALGROUPSETMEMBERS_OBJ = localgroup/localgroup_setmembers.o $(CMDLINE_OBJ)
115 LOCALGROUPGETMEMBERS_OBJ = localgroup/localgroup_getmembers.o $(CMDLINE_OBJ)
116 REMOTETOD_OBJ = server/remote_tod.o $(CMDLINE_OBJ)
117 SHAREADD_OBJ = share/share_add.o $(CMDLINE_OBJ)
118 SHAREDEL_OBJ = share/share_del.o $(CMDLINE_OBJ)
119 SHAREENUM_OBJ = share/share_enum.o $(CMDLINE_OBJ)
120
121 bin/getdc@EXEEXT@: $(BINARY_PREREQS) $(GETDC_OBJ)
122         @echo Linking $@
123         @$(CC) $(FLAGS) -o $@ $(GETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
124
125 bin/dsgetdc@EXEEXT@: $(BINARY_PREREQS) $(DSGETDC_OBJ)
126         @echo Linking $@
127         @$(CC) $(FLAGS) -o $@ $(DSGETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
128
129 bin/getjoinableous@EXEEXT@: $(BINARY_PREREQS) $(GETJOINABLEOUS_OBJ)
130         @echo Linking $@
131         @$(CC) $(FLAGS) -o $@ $(GETJOINABLEOUS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
132
133 bin/netdomjoin@EXEEXT@: $(BINARY_PREREQS) $(NETDOMJOIN_OBJ)
134         @echo Linking $@
135         @$(CC) $(FLAGS) -o $@ $(NETDOMJOIN_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
136
137 bin/netdomjoin-gui@EXEEXT@: $(BINARY_PREREQS) $(NETDOMJOIN_GUI_OBJ)
138         @echo Linking $@
139         @$(CC) $(FLAGS) $(GTK_FLAGS) -o $@ $(NETDOMJOIN_GUI_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(GTK_LIBS)
140
141 bin/user_add@EXEEXT@: $(BINARY_PREREQS) $(USERADD_OBJ)
142         @echo Linking $@
143         @$(CC) $(FLAGS) -o $@ $(USERADD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
144
145 bin/user_del@EXEEXT@: $(BINARY_PREREQS) $(USERDEL_OBJ)
146         @echo Linking $@
147         @$(CC) $(FLAGS) -o $@ $(USERDEL_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
148
149 bin/user_enum@EXEEXT@: $(BINARY_PREREQS) $(USERENUM_OBJ)
150         @echo Linking $@
151         @$(CC) $(FLAGS) -o $@ $(USERENUM_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
152
153 bin/user_dispinfo@EXEEXT@: $(BINARY_PREREQS) $(USERDISPINFO_OBJ)
154         @echo Linking $@
155         @$(CC) $(FLAGS) -o $@ $(USERDISPINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
156
157 bin/user_chgpwd@EXEEXT@: $(BINARY_PREREQS) $(USERCHGPWD_OBJ)
158         @echo Linking $@
159         @$(CC) $(FLAGS) -o $@ $(USERCHGPWD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
160
161 bin/user_getinfo@EXEEXT@: $(BINARY_PREREQS) $(USERGETINFO_OBJ)
162         @echo Linking $@
163         @$(CC) $(FLAGS) -o $@ $(USERGETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
164
165 bin/user_setinfo@EXEEXT@: $(BINARY_PREREQS) $(USERSETINFO_OBJ)
166         @echo Linking $@
167         @$(CC) $(FLAGS) -o $@ $(USERSETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
168
169 bin/user_modalsget@EXEEXT@: $(BINARY_PREREQS) $(USERMODALSGET_OBJ)
170         @echo Linking $@
171         @$(CC) $(FLAGS) -o $@ $(USERMODALSGET_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
172
173 bin/user_modalsset@EXEEXT@: $(BINARY_PREREQS) $(USERMODALSSET_OBJ)
174         @echo Linking $@
175         @$(CC) $(FLAGS) -o $@ $(USERMODALSSET_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
176
177 bin/user_getgroups@EXEEXT@: $(BINARY_PREREQS) $(USERGETGROUPS_OBJ)
178         @echo Linking $@
179         @$(CC) $(FLAGS) -o $@ $(USERGETGROUPS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
180
181 bin/group_add@EXEEXT@: $(BINARY_PREREQS) $(GROUPADD_OBJ)
182         @echo Linking $@
183         @$(CC) $(FLAGS) -o $@ $(GROUPADD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
184
185 bin/group_del@EXEEXT@: $(BINARY_PREREQS) $(GROUPDEL_OBJ)
186         @echo Linking $@
187         @$(CC) $(FLAGS) -o $@ $(GROUPDEL_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
188
189 bin/group_enum@EXEEXT@: $(BINARY_PREREQS) $(GROUPENUM_OBJ)
190         @echo Linking $@
191         @$(CC) $(FLAGS) -o $@ $(GROUPENUM_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
192
193 bin/group_setinfo@EXEEXT@: $(BINARY_PREREQS) $(GROUPSETINFO_OBJ)
194         @echo Linking $@
195         @$(CC) $(FLAGS) -o $@ $(GROUPSETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
196
197 bin/group_getinfo@EXEEXT@: $(BINARY_PREREQS) $(GROUPGETINFO_OBJ)
198         @echo Linking $@
199         @$(CC) $(FLAGS) -o $@ $(GROUPGETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
200
201 bin/group_adduser@EXEEXT@: $(BINARY_PREREQS) $(GROUPADDUSER_OBJ)
202         @echo Linking $@
203         @$(CC) $(FLAGS) -o $@ $(GROUPADDUSER_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
204
205 bin/group_deluser@EXEEXT@: $(BINARY_PREREQS) $(GROUPDELUSER_OBJ)
206         @echo Linking $@
207         @$(CC) $(FLAGS) -o $@ $(GROUPDELUSER_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
208
209 bin/group_getusers@EXEEXT@: $(BINARY_PREREQS) $(GROUPGETUSERS_OBJ)
210         @echo Linking $@
211         @$(CC) $(FLAGS) -o $@ $(GROUPGETUSERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
212
213 bin/localgroup_add@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPADD_OBJ)
214         @echo Linking $@
215         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPADD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
216
217 bin/localgroup_del@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPDEL_OBJ)
218         @echo Linking $@
219         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPDEL_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
220
221 bin/localgroup_getinfo@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPGETINFO_OBJ)
222         @echo Linking $@
223         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPGETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
224
225 bin/localgroup_setinfo@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPSETINFO_OBJ)
226         @echo Linking $@
227         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPSETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
228
229 bin/localgroup_enum@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPENUM_OBJ)
230         @echo Linking $@
231         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPENUM_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
232
233 bin/localgroup_addmembers@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPADDMEMBERS_OBJ)
234         @echo Linking $@
235         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPADDMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
236
237 bin/localgroup_delmembers@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPDELMEMBERS_OBJ)
238         @echo Linking $@
239         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPDELMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
240
241 bin/localgroup_setmembers@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPSETMEMBERS_OBJ)
242         @echo Linking $@
243         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPSETMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
244
245 bin/localgroup_getmembers@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPGETMEMBERS_OBJ)
246         @echo Linking $@
247         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPGETMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
248
249 bin/remote_tod@EXEEXT@: $(BINARY_PREREQS) $(REMOTETOD_OBJ)
250         @echo Linking $@
251         @$(CC) $(FLAGS) -o $@ $(REMOTETOD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
252
253 bin/share_add@EXEEXT@: $(BINARY_PREREQS) $(SHAREADD_OBJ)
254         @echo Linking $@
255         @$(CC) $(FLAGS) -o $@ $(SHAREADD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
256
257 bin/share_del@EXEEXT@: $(BINARY_PREREQS) $(SHAREDEL_OBJ)
258         @echo Linking $@
259         @$(CC) $(FLAGS) -o $@ $(SHAREDEL_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
260
261 bin/share_enum@EXEEXT@: $(BINARY_PREREQS) $(SHAREENUM_OBJ)
262         @echo Linking $@
263         @$(CC) $(FLAGS) -o $@ $(SHAREENUM_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
264
265 clean:
266         -rm -f $(PROGS)
267         -rm -f core */*~ *~ \
268                 */*.o */*/*.o */*/*/*.o