netapi: add NetUserGetGroups 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
54 all: $(PROGS)
55
56 MAKEDIR = || exec false; \
57           if test -d "$$dir"; then :; else \
58           echo mkdir "$$dir"; \
59           mkdir -p "$$dir" >/dev/null 2>&1 || \
60           test -d "$$dir" || \
61           mkdir "$$dir" || \
62           exec false; fi || exec false
63
64 BINARY_PREREQS = bin/.dummy
65
66 bin/.dummy:
67         @if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \
68           dir=bin $(MAKEDIR); fi
69         @: >> $@ || : > $@ # what a fancy emoticon!
70
71 .c.o:
72         @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
73          dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
74         @echo Compiling $*.c
75         @$(COMPILE) && exit 0;\
76                 echo "The following command failed:" 1>&2;\
77                 echo "$(COMPILE_CC)" 1>&2;\
78                 $(COMPILE_CC) >/dev/null 2>&1
79
80 CMDLINE_OBJ = common.o
81 GETDC_OBJ = getdc/getdc.o $(CMDLINE_OBJ)
82 DSGETDC_OBJ = dsgetdc/dsgetdc.o $(CMDLINE_OBJ)
83 NETDOMJOIN_OBJ = netdomjoin/netdomjoin.o $(CMDLINE_OBJ)
84 NETDOMJOIN_GUI_OBJ = netdomjoin-gui/netdomjoin-gui.o
85 GETJOINABLEOUS_OBJ = getjoinableous/getjoinableous.o $(CMDLINE_OBJ)
86 USERADD_OBJ = user/user_add.o $(CMDLINE_OBJ)
87 USERDEL_OBJ = user/user_del.o $(CMDLINE_OBJ)
88 USERENUM_OBJ = user/user_enum.o $(CMDLINE_OBJ)
89 USERDISPINFO_OBJ = user/user_dispinfo.o $(CMDLINE_OBJ)
90 USERCHGPWD_OBJ = user/user_chgpwd.o $(CMDLINE_OBJ)
91 USERGETINFO_OBJ = user/user_getinfo.o $(CMDLINE_OBJ)
92 USERSETINFO_OBJ = user/user_setinfo.o $(CMDLINE_OBJ)
93 USERMODALSGET_OBJ = user/user_modalsget.o $(CMDLINE_OBJ)
94 USERMODALSSET_OBJ = user/user_modalsset.o $(CMDLINE_OBJ)
95 USERGETGROUPS_OBJ = user/user_getgroups.o $(CMDLINE_OBJ)
96 GROUPADD_OBJ = group/group_add.o $(CMDLINE_OBJ)
97 GROUPDEL_OBJ = group/group_del.o $(CMDLINE_OBJ)
98 GROUPENUM_OBJ = group/group_enum.o $(CMDLINE_OBJ)
99 GROUPSETINFO_OBJ = group/group_setinfo.o $(CMDLINE_OBJ)
100 GROUPGETINFO_OBJ = group/group_getinfo.o $(CMDLINE_OBJ)
101 GROUPADDUSER_OBJ = group/group_adduser.o $(CMDLINE_OBJ)
102 GROUPDELUSER_OBJ = group/group_deluser.o $(CMDLINE_OBJ)
103 GROUPGETUSERS_OBJ = group/group_getusers.o $(CMDLINE_OBJ)
104 LOCALGROUPADD_OBJ = localgroup/localgroup_add.o $(CMDLINE_OBJ)
105 LOCALGROUPDEL_OBJ = localgroup/localgroup_del.o $(CMDLINE_OBJ)
106 LOCALGROUPGETINFO_OBJ = localgroup/localgroup_getinfo.o $(CMDLINE_OBJ)
107 LOCALGROUPSETINFO_OBJ = localgroup/localgroup_setinfo.o $(CMDLINE_OBJ)
108 LOCALGROUPENUM_OBJ = localgroup/localgroup_enum.o $(CMDLINE_OBJ)
109 LOCALGROUPADDMEMBERS_OBJ = localgroup/localgroup_addmembers.o $(CMDLINE_OBJ)
110 LOCALGROUPDELMEMBERS_OBJ = localgroup/localgroup_delmembers.o $(CMDLINE_OBJ)
111 LOCALGROUPSETMEMBERS_OBJ = localgroup/localgroup_setmembers.o $(CMDLINE_OBJ)
112 LOCALGROUPGETMEMBERS_OBJ = localgroup/localgroup_getmembers.o $(CMDLINE_OBJ)
113 REMOTETOD_OBJ = server/remote_tod.o $(CMDLINE_OBJ)
114
115 bin/getdc@EXEEXT@: $(BINARY_PREREQS) $(GETDC_OBJ)
116         @echo Linking $@
117         @$(CC) $(FLAGS) -o $@ $(GETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
118
119 bin/dsgetdc@EXEEXT@: $(BINARY_PREREQS) $(DSGETDC_OBJ)
120         @echo Linking $@
121         @$(CC) $(FLAGS) -o $@ $(DSGETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
122
123 bin/getjoinableous@EXEEXT@: $(BINARY_PREREQS) $(GETJOINABLEOUS_OBJ)
124         @echo Linking $@
125         @$(CC) $(FLAGS) -o $@ $(GETJOINABLEOUS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
126
127 bin/netdomjoin@EXEEXT@: $(BINARY_PREREQS) $(NETDOMJOIN_OBJ)
128         @echo Linking $@
129         @$(CC) $(FLAGS) -o $@ $(NETDOMJOIN_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
130
131 bin/netdomjoin-gui@EXEEXT@: $(BINARY_PREREQS) $(NETDOMJOIN_GUI_OBJ)
132         @echo Linking $@
133         @$(CC) $(FLAGS) $(GTK_FLAGS) -o $@ $(NETDOMJOIN_GUI_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(GTK_LIBS)
134
135 bin/user_add@EXEEXT@: $(BINARY_PREREQS) $(USERADD_OBJ)
136         @echo Linking $@
137         @$(CC) $(FLAGS) -o $@ $(USERADD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
138
139 bin/user_del@EXEEXT@: $(BINARY_PREREQS) $(USERDEL_OBJ)
140         @echo Linking $@
141         @$(CC) $(FLAGS) -o $@ $(USERDEL_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
142
143 bin/user_enum@EXEEXT@: $(BINARY_PREREQS) $(USERENUM_OBJ)
144         @echo Linking $@
145         @$(CC) $(FLAGS) -o $@ $(USERENUM_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
146
147 bin/user_dispinfo@EXEEXT@: $(BINARY_PREREQS) $(USERDISPINFO_OBJ)
148         @echo Linking $@
149         @$(CC) $(FLAGS) -o $@ $(USERDISPINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
150
151 bin/user_chgpwd@EXEEXT@: $(BINARY_PREREQS) $(USERCHGPWD_OBJ)
152         @echo Linking $@
153         @$(CC) $(FLAGS) -o $@ $(USERCHGPWD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
154
155 bin/user_getinfo@EXEEXT@: $(BINARY_PREREQS) $(USERGETINFO_OBJ)
156         @echo Linking $@
157         @$(CC) $(FLAGS) -o $@ $(USERGETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
158
159 bin/user_setinfo@EXEEXT@: $(BINARY_PREREQS) $(USERSETINFO_OBJ)
160         @echo Linking $@
161         @$(CC) $(FLAGS) -o $@ $(USERSETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
162
163 bin/user_modalsget@EXEEXT@: $(BINARY_PREREQS) $(USERMODALSGET_OBJ)
164         @echo Linking $@
165         @$(CC) $(FLAGS) -o $@ $(USERMODALSGET_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
166
167 bin/user_modalsset@EXEEXT@: $(BINARY_PREREQS) $(USERMODALSSET_OBJ)
168         @echo Linking $@
169         @$(CC) $(FLAGS) -o $@ $(USERMODALSSET_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
170
171 bin/user_getgroups@EXEEXT@: $(BINARY_PREREQS) $(USERGETGROUPS_OBJ)
172         @echo Linking $@
173         @$(CC) $(FLAGS) -o $@ $(USERGETGROUPS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
174
175 bin/group_add@EXEEXT@: $(BINARY_PREREQS) $(GROUPADD_OBJ)
176         @echo Linking $@
177         @$(CC) $(FLAGS) -o $@ $(GROUPADD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
178
179 bin/group_del@EXEEXT@: $(BINARY_PREREQS) $(GROUPDEL_OBJ)
180         @echo Linking $@
181         @$(CC) $(FLAGS) -o $@ $(GROUPDEL_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
182
183 bin/group_enum@EXEEXT@: $(BINARY_PREREQS) $(GROUPENUM_OBJ)
184         @echo Linking $@
185         @$(CC) $(FLAGS) -o $@ $(GROUPENUM_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
186
187 bin/group_setinfo@EXEEXT@: $(BINARY_PREREQS) $(GROUPSETINFO_OBJ)
188         @echo Linking $@
189         @$(CC) $(FLAGS) -o $@ $(GROUPSETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
190
191 bin/group_getinfo@EXEEXT@: $(BINARY_PREREQS) $(GROUPGETINFO_OBJ)
192         @echo Linking $@
193         @$(CC) $(FLAGS) -o $@ $(GROUPGETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
194
195 bin/group_adduser@EXEEXT@: $(BINARY_PREREQS) $(GROUPADDUSER_OBJ)
196         @echo Linking $@
197         @$(CC) $(FLAGS) -o $@ $(GROUPADDUSER_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
198
199 bin/group_deluser@EXEEXT@: $(BINARY_PREREQS) $(GROUPDELUSER_OBJ)
200         @echo Linking $@
201         @$(CC) $(FLAGS) -o $@ $(GROUPDELUSER_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
202
203 bin/group_getusers@EXEEXT@: $(BINARY_PREREQS) $(GROUPGETUSERS_OBJ)
204         @echo Linking $@
205         @$(CC) $(FLAGS) -o $@ $(GROUPGETUSERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
206
207 bin/localgroup_add@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPADD_OBJ)
208         @echo Linking $@
209         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPADD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
210
211 bin/localgroup_del@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPDEL_OBJ)
212         @echo Linking $@
213         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPDEL_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
214
215 bin/localgroup_getinfo@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPGETINFO_OBJ)
216         @echo Linking $@
217         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPGETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
218
219 bin/localgroup_setinfo@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPSETINFO_OBJ)
220         @echo Linking $@
221         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPSETINFO_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
222
223 bin/localgroup_enum@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPENUM_OBJ)
224         @echo Linking $@
225         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPENUM_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
226
227 bin/localgroup_addmembers@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPADDMEMBERS_OBJ)
228         @echo Linking $@
229         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPADDMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
230
231 bin/localgroup_delmembers@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPDELMEMBERS_OBJ)
232         @echo Linking $@
233         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPDELMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
234
235 bin/localgroup_setmembers@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPSETMEMBERS_OBJ)
236         @echo Linking $@
237         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPSETMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
238
239 bin/localgroup_getmembers@EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPGETMEMBERS_OBJ)
240         @echo Linking $@
241         @$(CC) $(FLAGS) -o $@ $(LOCALGROUPGETMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
242
243 bin/remote_tod@EXEEXT@: $(BINARY_PREREQS) $(REMOTETOD_OBJ)
244         @echo Linking $@
245         @$(CC) $(FLAGS) -o $@ $(REMOTETOD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
246
247 clean:
248         -rm -f $(PROGS)
249         -rm -f core */*~ *~ \
250                 */*.o */*/*.o */*/*/*.o