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