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