1# 2# CGI makefile for CUPS. 3# 4# Copyright © 2007-2019 by Apple Inc. 5# Copyright © 1997-2006 by Easy Software Products. 6# 7# Licensed under Apache License v2.0. See the file "LICENSE" for more 8# information. 9# 10 11include ../Makedefs 12 13LIBOBJS = \ 14 help-index.o \ 15 html.o \ 16 ipp-var.o \ 17 search.o \ 18 template.o \ 19 var.o 20OBJS = \ 21 $(LIBOBJS) \ 22 admin.o \ 23 classes.o \ 24 help.o \ 25 jobs.o \ 26 makedocset.o \ 27 printers.o \ 28 testcgi.o \ 29 testhi.o \ 30 testtemplate.o 31CGIS = \ 32 admin.cgi \ 33 classes.cgi \ 34 help.cgi \ 35 jobs.cgi \ 36 printers.cgi 37LIBTARGETS = \ 38 libcupscgi.a 39 40UNITTARGETS = \ 41 testcgi \ 42 testhi \ 43 testtemplate 44 45TARGETS = \ 46 $(LIBTARGETS) \ 47 $(CGIS) 48 49 50# 51# Make all targets... 52# 53 54all: $(TARGETS) 55 56 57# 58# Make library targets... 59# 60 61libs: 62 63 64# 65# Make unit tests... 66# 67 68unittests: $(UNITTARGETS) 69 70 71# 72# Clean all object files... 73# 74 75clean: 76 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) makedocset 77 78 79# 80# Update dependencies (without system header dependencies...) 81# 82 83depend: 84 $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies 85 86 87# 88# Install all targets... 89# 90 91install: all install-data install-headers install-libs install-exec 92 93 94# 95# Install data files... 96# 97 98install-data: 99 100 101# 102# Install programs... 103# 104 105install-exec: 106 $(INSTALL_DIR) -m 755 $(SERVERBIN)/cgi-bin 107 for file in $(CGIS); do \ 108 $(INSTALL_BIN) $$file $(SERVERBIN)/cgi-bin; \ 109 done 110 if test "x$(SYMROOT)" != "x"; then \ 111 $(INSTALL_DIR) $(SYMROOT); \ 112 for file in $(CGIS); do \ 113 cp $$file $(SYMROOT); \ 114 dsymutil $(SYMROOT)/$$file; \ 115 done \ 116 fi 117 118 119# 120# Install headers... 121# 122 123install-headers: 124 125 126# 127# Install libraries... 128# 129 130install-libs: 131 132 133# 134# Uninstall all targets... 135# 136 137uninstall: 138 for file in $(CGIS); do \ 139 $(RM) $(SERVERBIN)/cgi-bin/$$file; \ 140 done 141 -$(RMDIR) $(SERVERBIN)/cgi-bin 142 143 144# 145# libcupscgi.a 146# 147 148libcupscgi.a: $(LIBOBJS) 149 echo Archiving $@... 150 $(RM) $@ 151 $(AR) $(ARFLAGS) $@ $(LIBOBJS) 152 $(RANLIB) $@ 153 154 155# 156# admin.cgi 157# 158 159admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a 160 echo Linking $@... 161 $(LD_CC) $(ALL_LDFLAGS) -o $@ admin.o libcupscgi.a $(LINKCUPS) 162 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ 163 164 165# 166# classes.cgi 167# 168 169classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a 170 echo Linking $@... 171 $(LD_CC) $(ALL_LDFLAGS) -o $@ classes.o libcupscgi.a $(LINKCUPS) 172 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ 173 174 175# 176# help.cgi 177# 178 179help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a 180 echo Linking $@... 181 $(LD_CC) $(ALL_LDFLAGS) -o $@ help.o libcupscgi.a $(LINKCUPS) 182 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ 183 184 185# 186# jobs.cgi 187# 188 189jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a 190 echo Linking $@... 191 $(LD_CC) $(ALL_LDFLAGS) -o $@ jobs.o libcupscgi.a $(LINKCUPS) 192 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ 193 194 195# 196# printers.cgi 197# 198 199printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a 200 echo Linking $@... 201 $(LD_CC) $(ALL_LDFLAGS) -o $@ printers.o libcupscgi.a $(LINKCUPS) 202 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ 203 204 205# 206# testcgi 207# 208 209testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC) 210 echo Linking $@... 211 $(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testcgi.o libcupscgi.a \ 212 $(LINKCUPSSTATIC) 213 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ 214 echo Testing CGI API... 215 ./testcgi 216 217 218# 219# testhi 220# 221 222testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC) 223 echo Linking $@... 224 $(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testhi.o libcupscgi.a \ 225 $(LINKCUPSSTATIC) 226 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ 227 echo Testing help index API... 228 ./testhi 229 230 231# 232# testtemplate 233# 234 235testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC) 236 echo Linking $@... 237 $(LD_CC) $(ALL_LDFLAGS) -o $@ testtemplate.o libcupscgi.a $(LINKCUPSSTATIC) 238 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ 239 240 241# 242# Dependencies... 243# 244 245include Dependencies 246