]> sourceware.org Git - newlib-cygwin.git/blob - winsup/cygwin/Makefile.in
Cygwin: Drop do-nothing install_host target
[newlib-cygwin.git] / winsup / cygwin / Makefile.in
1 # Makefile.in for Cygwin.
2 #
3 # This file is part of Cygwin.
4 #
5 # This software is a copyrighted work licensed under the terms of the
6 # Cygwin license. Please consult the file "CYGWIN_LICENSE" for
7 # details.
8 # configure_input: @configure_input@
9
10 # This makefile requires GNU make.
11
12 srcdir:=@srcdir@
13 target_builddir:=@target_builddir@
14 winsup_srcdir:=@winsup_srcdir@
15 configure_args=@configure_args@
16
17 CFLAGS?=@CFLAGS@
18 CXXFLAGS?=@CXXFLAGS@
19 INCLUDES?=@INCLUDES@
20
21 include ${srcdir}/../Makefile.common
22
23 VPATH+=$(srcdir)/regex $(srcdir)/lib $(srcdir)/libc $(srcdir)/math $(srcdir)/tzcode
24
25 target_cpu:=@target_cpu@
26 target_alias:=@target_alias@
27 build_alias:=@build_alias@
28 host_alias:=@host_alias@
29 prefix:=@prefix@
30
31 program_transform_name:=@program_transform_name@
32 exec_prefix:=@exec_prefix@
33 bindir:=@bindir@
34 libdir:=@libdir@
35 mandir:=@mandir@
36 sysconfdir:=@sysconfdir@
37 datarootdir:=@datarootdir@
38 ifeq ($(target_alias),$(host_alias))
39 ifeq ($(build_alias),$(host_alias))
40 tooldir:=$(exec_prefix)
41 else
42 tooldir:=$(exec_prefix)/$(target_alias)
43 endif
44 else
45 tooldir:=$(exec_prefix)/$(target_alias)
46 endif
47 datadir:=@datadir@
48 infodir:=@infodir@
49 includedir:=@includedir@
50
51 override INSTALL:=@INSTALL@
52 override INSTALL_PROGRAM:=@INSTALL_PROGRAM@
53 override INSTALL_DATA:=@INSTALL_DATA@
54
55 cygserver_blddir:=${target_builddir}/winsup/cygserver
56 LIBSERVER:=${cygserver_blddir}/libcygserver.a
57
58 LIBC:=$(newlib_build)/libc/libc.a
59 LIBM:=$(newlib_build)/libm/libm.a
60 CRT0:=$(cygwin_build)/crt0.o
61
62 #
63 # --enable options from configure
64 #
65 CCEXTRA=
66 COMMON_CFLAGS=-MMD ${$(*F)_CFLAGS} -Wimplicit-fallthrough=5 -Werror -fmerge-constants -ftracer $(CCEXTRA)
67 ifeq ($(target_cpu),x86_64)
68 COMMON_CFLAGS+=-mcmodel=small
69 endif
70 COMPILE.cc+=${COMMON_CFLAGS} # -std=gnu++14
71 COMPILE.c+=${COMMON_CFLAGS}
72
73 AR:=@AR@
74 AR_FLAGS:=qv
75 RANLIB:=@RANLIB@
76 LD:=@LD@
77 DLLTOOL:=@DLLTOOL@
78 WINDRES:=@WINDRES@
79 AS:=@AS@
80 NM:=@NM@
81 OBJCOPY:=@OBJCOPY@
82 OBJDUMP:=@OBJDUMP@
83 STRIP:=@STRIP@
84 LDSCRIPT:=cygwin.sc
85 MKDIRP:=$(INSTALL) -m 755 -d
86
87 # Setup the testing framework, if you have one
88 EXPECT = `if [ -f $${rootme}/../../expect/expect$(EXEEXT) ] ; then \
89 echo $${rootme}/../../expect/expect$(EXEEXT) ; \
90 else echo expect ; fi`
91
92 RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
93 echo $${srcdir}/../dejagnu/runtest ; \
94 else echo runtest; fi`
95 RUNTESTFLAGS =
96
97 # Parameters used in building the cygwin.dll.
98 # We build as cygwin0.dll and rename at install time to overcome
99 # native rebuilding issues (we don't want the build tools to see a partially
100 # built cygwin.dll and attempt to use it instead of the old one).
101
102 DLL_NAME:=@DLL_NAME@
103 TEST_DLL_NAME:=${patsubst %1.dll,%0.dll,@DLL_NAME@}
104 TEST_LIB_NAME:=libcygwin0.a
105 STATIC_LIB_NAME:=libcygwin_s.a
106 DIN_FILE=@DIN_FILE@ common.din
107 DEF_FILE:=cygwin.def
108 TLSOFFSETS_H:=@TLSOFFSETS_H@
109 DLL_ENTRY:=@DLL_ENTRY@
110
111 LIBGMON_A:=libgmon.a
112 CYGWIN_START:=crt0.o
113 GMON_START:=gcrt0.o
114
115 toolopts:=--cpu=${target_cpu} --ar=${AR} --as=${AS} --nm=${NM} --objcopy=${OBJCOPY}
116 speclib=\
117 ${srcdir}/speclib ${toolopts} \
118 --exclude='cygwin' \
119 --exclude='(?i:dll)' \
120 --exclude='reloc' \
121 --exclude='^main$$' \
122 --exclude='^_main$$' \
123 $^
124
125 # Some things want these from libc, but they have their own static
126 # data which apps can get to, which is a pain in the dll, so we
127 # include them directly into the library.
128
129 LIBCOS:=${sort ${addsuffix .o,${basename ${notdir ${wildcard $(srcdir)/lib/*.c}}}} \
130 ${addsuffix .o,${basename ${notdir ${wildcard $(srcdir)/lib/*.cc}}}}}
131
132 # Build all source files in the config directory
133
134 EXTRA_OFILES:=
135
136 MALLOC_OFILES:=malloc.o
137
138 DLL_IMPORTS:=${shell $(CC) -print-file-name=w32api/libkernel32.a} ${shell $(CC) -print-file-name=w32api/libntdll.a}
139
140 #
141 LIBC_OFILES:= \
142 arc4random_stir.o \
143 base64.o \
144 bsdlib.o \
145 call_once.o \
146 cnd.o \
147 fnmatch.o \
148 fts.o \
149 ftw.o \
150 getentropy.o \
151 getopt.o \
152 inet_addr.o \
153 inet_network.o \
154 minires-os-if.o \
155 minires.o \
156 msgcat.o \
157 mtx.o \
158 nftw.o \
159 rcmd.o \
160 rexec.o \
161 strfmon.o \
162 strptime.o \
163 thrd.o \
164 tss.o \
165 xsique.o
166
167 MATH_OFILES:= \
168 acoshl.o \
169 acosl.o \
170 asinhl.o \
171 asinl.o \
172 atan2l.o \
173 atanhl.o \
174 atanl.o \
175 cabsl.o \
176 cacosl.o \
177 cargl.o \
178 casinl.o \
179 catanl.o \
180 cbrtl.o \
181 ccosl.o \
182 ceill.o \
183 cephes_emath.o \
184 cexpl.o \
185 cimagl.o \
186 clog10l.o \
187 clogl.o \
188 conjl.o \
189 copysignl.o \
190 coshl.o \
191 cosl.o \
192 cosl_internal.o \
193 cossin.o \
194 cpowl.o \
195 cprojl.o \
196 creall.o \
197 csinl.o \
198 csqrtl.o \
199 ctanl.o \
200 erfl.o \
201 exp10l.o \
202 exp2l.o \
203 expl.o \
204 expm1l.o \
205 fabsl.o \
206 fdiml.o \
207 finite.o \
208 floorl.o \
209 fmal.o \
210 fmaxl.o \
211 fminl.o \
212 fmodl.o \
213 frexpl.o \
214 ilogbl.o \
215 internal_logl.o \
216 isinf.o \
217 isnan.o \
218 ldexpl.o \
219 lgammal.o \
220 llrint.o \
221 llrintf.o \
222 llrintl.o \
223 llroundl.o \
224 log10l.o \
225 log1pl.o \
226 log2l.o \
227 logbl.o \
228 logl.o \
229 lrint.o \
230 lrintf.o \
231 lrintl.o \
232 lroundl.o \
233 modfl.o \
234 nearbyint.o \
235 nearbyintf.o \
236 nearbyintl.o \
237 nextafterl.o \
238 nexttoward.o \
239 nexttowardf.o \
240 pow10l.o \
241 powil.o \
242 powl.o \
243 remainder.o \
244 remainderf.o \
245 remainderl.o \
246 remquol.o \
247 rint.o \
248 rintf.o \
249 rintl.o \
250 roundl.o \
251 scalbl.o \
252 scalbnl.o \
253 sinhl.o \
254 sinl.o \
255 sinl_internal.o \
256 sqrtl.o \
257 tanhl.o \
258 tanl.o \
259 tgammal.o \
260 truncl.o
261
262 TZCODE_OFILES:=localtime.o
263
264 DLL_OFILES:= \
265 advapi32.o \
266 aio.o \
267 assert.o \
268 autoload.o \
269 clock.o \
270 ctype.o \
271 cxx.o \
272 cygheap.o \
273 cygthread.o \
274 cygtls.o \
275 cygwait.o \
276 cygxdr.o \
277 dcrt0.o \
278 debug.o \
279 devices.o \
280 dir.o \
281 dlfcn.o \
282 dll_init.o \
283 dtable.o \
284 environ.o \
285 errno.o \
286 exceptions.o \
287 exec.o \
288 external.o \
289 fcntl.o \
290 fenv.o \
291 fhandler.o \
292 fhandler_clipboard.o \
293 fhandler_console.o \
294 fhandler_cygdrive.o \
295 fhandler_dev.o \
296 fhandler_disk_file.o \
297 fhandler_dsp.o \
298 fhandler_fifo.o \
299 fhandler_floppy.o \
300 fhandler_netdrive.o \
301 fhandler_nodevice.o \
302 fhandler_pipe.o \
303 fhandler_proc.o \
304 fhandler_process.o \
305 fhandler_process_fd.o \
306 fhandler_procnet.o \
307 fhandler_procsys.o \
308 fhandler_procsysvipc.o \
309 fhandler_random.o \
310 fhandler_raw.o \
311 fhandler_registry.o \
312 fhandler_serial.o \
313 fhandler_signalfd.o \
314 fhandler_socket.o \
315 fhandler_socket_inet.o \
316 fhandler_socket_local.o \
317 fhandler_socket_unix.o \
318 fhandler_tape.o \
319 fhandler_termios.o \
320 fhandler_timerfd.o \
321 fhandler_tty.o \
322 fhandler_virtual.o \
323 fhandler_windows.o \
324 fhandler_zero.o \
325 flock.o \
326 fork.o \
327 forkable.o \
328 glob.o \
329 glob_pattern_p.o \
330 globals.o \
331 grp.o \
332 heap.o \
333 hookapi.o \
334 init.o \
335 ioctl.o \
336 ipc.o \
337 kernel32.o \
338 ldap.o \
339 libstdcxx_wrapper.o \
340 loadavg.o \
341 lsearch.o \
342 malloc_wrapper.o \
343 miscfuncs.o \
344 mktemp.o \
345 mmap.o \
346 mmap_alloc.o \
347 msg.o \
348 mount.o \
349 net.o \
350 netdb.o \
351 nfs.o \
352 nlsfuncs.o \
353 ntea.o \
354 passwd.o \
355 path.o \
356 pinfo.o \
357 poll.o \
358 posix_ipc.o \
359 posix_timer.o \
360 pseudo-reloc.o \
361 pthread.o \
362 quotactl.o \
363 random.o \
364 regcomp.o \
365 regerror.o \
366 regexec.o \
367 regfree.o \
368 registry.o \
369 resource.o \
370 scandir.o \
371 sched.o \
372 sec_acl.o \
373 sec_auth.o \
374 sec_helper.o \
375 sec_posixacl.o \
376 security.o \
377 select.o \
378 sem.o \
379 setlsapwd.o \
380 shared.o \
381 shm.o \
382 sigfe.o \
383 signal.o \
384 sigproc.o \
385 smallprint.o \
386 spawn.o \
387 strace.o \
388 strfuncs.o \
389 strsep.o \
390 strsig.o \
391 sync.o \
392 syscalls.o \
393 sysconf.o \
394 syslog.o \
395 termios.o \
396 thread.o \
397 timerfd.o \
398 times.o \
399 tls_pbuf.o \
400 tty.o \
401 uinfo.o \
402 uname.o \
403 wait.o \
404 wincap.o \
405 window.o \
406 winf.o \
407 $(EXTRA_OFILES) \
408 $(MALLOC_OFILES) \
409 $(LIBC_OFILES) \
410 $(MATH_OFILES) \
411 $(TZCODE_OFILES)
412
413 EXCLUDE_STATIC_OFILES:=$(addprefix --exclude=,\
414 cygtls.o \
415 dcrt0.o \
416 exceptions.o \
417 fork.o \
418 signal.o \
419 spawn.o \
420 )
421
422 VERSION_OFILES:=version.o winver.o
423
424 ifdef PREPROCESS
425 override DLL_OFILES:=$(patsubst %.o,%_E,${DLL_OFILES})
426 override EXCLUDE_STATIC_OFILES:=$(patsubst %.o,%_E,${EXCLUDE_STATIC_OFILES})
427 override EXTRA_OFILES=$(patsubst %.o,%_E,${DLL_OFILES}))
428 override MALLOC_OFILES:=$(patsubst %.o,%.E,${MALLOC_OFILES})
429 endif #PREPROCESS
430
431 ifeq ($(target_cpu),x86_64)
432 # Needed by mcountFunc.S to choose the right code path and symbol names
433 ASFLAGS:=-D_WIN64
434 endif
435
436 GMON_OFILES:=gmon.o mcount.o profil.o mcountFunc.o
437
438 NEW_FUNCTIONS:=$(addprefix --replace=,\
439 atexit= \
440 timezone= \
441 uname=uname_x \
442 __xdrrec_getrec= \
443 __xdrrec_setnonblock= \
444 xdr_array= \
445 xdr_bool= \
446 xdr_bytes= \
447 xdr_char= \
448 xdr_double= \
449 xdr_enum= \
450 xdr_float= \
451 xdr_free= \
452 xdr_hyper= \
453 xdr_int= \
454 xdr_int16_t= \
455 xdr_int32_t= \
456 xdr_int64_t= \
457 xdr_int8_t= \
458 xdr_long= \
459 xdr_longlong_t= \
460 xdr_netobj= \
461 xdr_opaque= \
462 xdr_pointer= \
463 xdr_reference= \
464 xdr_short= \
465 xdr_sizeof= \
466 xdr_string= \
467 xdr_u_char= \
468 xdr_u_hyper= \
469 xdr_u_int= \
470 xdr_u_int16_t= \
471 xdr_u_int32_t= \
472 xdr_u_int64_t= \
473 xdr_u_int8_t= \
474 xdr_u_long= \
475 xdr_u_longlong_t= \
476 xdr_u_short= \
477 xdr_uint16_t= \
478 xdr_uint32_t= \
479 xdr_uint64_t= \
480 xdr_uint8_t= \
481 xdr_union= \
482 xdr_vector= \
483 xdr_void= \
484 xdr_wrapstring= \
485 xdrmem_create= \
486 xdrrec_create= \
487 xdrrec_endofrecord= \
488 xdrrec_eof= \
489 xdrrec_skiprecord= \
490 xdrstdio_create= \
491 )
492 ifeq ($(target_cpu),x86_64)
493 NEW_FUNCTIONS+=
494 else
495 NEW_FUNCTIONS+=$(addprefix --replace=,\
496 acl=_acl32 \
497 aclcheck=_aclcheck32 \
498 aclfrommode=_aclfrommode32 \
499 aclfrompbits=_aclfrompbits32 \
500 aclfromtext=_aclfromtext32 \
501 aclsort=_aclsort32 \
502 acltomode=_acltomode32 \
503 acltopbits=_acltopbits32 \
504 acltotext=_acltotext32 \
505 chown=_chown32 \
506 facl=_facl32 \
507 fchown=_fchown32 \
508 fcntl=_fcntl64 \
509 fdopen=_fdopen64 \
510 fgetpos=_fgetpos64 \
511 fopen=_fopen64 \
512 freopen=_freopen64 \
513 fseeko=_fseeko64 \
514 fsetpos=_fsetpos64 \
515 fstat=_fstat64 \
516 ftello=_ftello64 \
517 ftruncate=_ftruncate64 \
518 getegid=_getegid32 \
519 geteuid=_geteuid32 \
520 getgid=_getgid32 \
521 getgrent=_getgrent32 \
522 getgrgid=_getgrgid32 \
523 getgrnam=_getgrnam32 \
524 getgroups=_getgroups32 \
525 getpwuid=_getpwuid32 \
526 getpwuid_r=_getpwuid_r32 \
527 getuid=_getuid32 \
528 initgroups=_initgroups32 \
529 lchown=_lchown32 \
530 lseek=_lseek64 \
531 lstat=_lstat64 \
532 mknod=_mknod32 \
533 mmap=_mmap64 \
534 open=_open64 \
535 setegid=_setegid32 \
536 seteuid=_seteuid32 \
537 setgid=_setgid32 \
538 setgroups=_setgroups32 \
539 setregid=_setregid32 \
540 setreuid=_setreuid32 \
541 setuid=_setuid32 \
542 stat=_stat64 \
543 tmpfile=_tmpfile64 \
544 truncate=_truncate64 \
545 )
546 endif
547
548 API_VER:=$(srcdir)/include/cygwin/version.h
549
550 LIB_NAME:=libcygwin.a
551 SUBLIBS:=libpthread.a libutil.a ${CURDIR}/libm.a ${CURDIR}/libc.a libdl.a libresolv.a librt.a libacl.a libssp.a
552 EXTRALIBS:=libautomode.a libbinmode.a libtextmode.a libtextreadmode.a
553 INSTOBJS:=automode.o binmode.o textmode.o textreadmode.o
554 TARGET_LIBS:=$(LIB_NAME) $(CYGWIN_START) $(GMON_START) $(LIBGMON_A) $(SUBLIBS) $(INSTOBJS) $(EXTRALIBS)
555
556 ifneq "${filter -O%,$(CFLAGS)}" ""
557 dtable_CFLAGS:=-fcheck-new
558 localtime_CFLAGS:=-fwrapv
559 malloc_CFLAGS:=-O3
560 sync_CFLAGS:=-O3
561 ifeq ($(target_cpu),i686)
562 # on x86, exceptions.cc must be compiled with a frame-pointer as it uses RtlCaptureContext()
563 exceptions_CFLAGS:=-fno-omit-frame-pointer
564 endif
565 endif
566 # required since gcc 9.x
567 exec_CFLAGS:=-fno-builtin-execve
568
569 fhandler_proc_CFLAGS+=-DUSERNAME="\"$(USER)\"" -DHOSTNAME="\"$(HOSTNAME)\""
570 fhandler_proc_CFLAGS+=-DGCC_VERSION="\"`$(CC) -v 2>&1 | tail -n 1`\""
571
572 .PHONY: all force dll_ofiles install all_target install_target all_host \
573 install install-libs install-headers \
574 clean distclean realclean maintainer-clean
575
576 all_host=@all_host@
577
578 all: all_target $(all_host)
579
580 all_target: $(TARGET_LIBS)
581
582 all_host: $(TEST_LIB_NAME)
583
584 force:
585
586 install: install-libs install-headers install-man install-ldif install_target \
587 $(install_target)
588
589 uninstall: uninstall-libs uninstall-headers uninstall-man
590
591 install-libs: $(TARGET_LIBS)
592 @$(MKDIRP) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/lib
593 $(INSTALL_PROGRAM) $(TEST_DLL_NAME) $(DESTDIR)$(bindir)/$(DLL_NAME); \
594 for i in $^; do \
595 $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/lib/`basename $$i` ; \
596 done
597 cd $(DESTDIR)$(tooldir)/lib && ln -sf libcygwin.a libg.a
598
599 install-headers:
600 cd $(srcdir); \
601 for sub in `find include -name '[a-z]*' -type d -print | sort`; do \
602 $(MKDIRP) $(DESTDIR)$(tooldir)/$$sub; \
603 for i in $$sub/*.h ; do \
604 $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/$$sub/`basename $$i` ; \
605 done ; \
606 done ; \
607
608 install-man:
609 @$(MKDIRP) $(DESTDIR)$(mandir)/man2 $(DESTDIR)$(mandir)/man3 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7
610 cd $(srcdir); \
611 for i in `find . -type f ! -path './release/*' -name '*.2'`; do \
612 $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man2/`basename $$i` ; \
613 done; \
614 for i in `find . -type f ! -path './release/*' -name '*.3'`; do \
615 $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man3/`basename $$i` ; \
616 done; \
617 for i in `find . -type f ! -path './release/*' -name '*.5'`; do \
618 $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man5/`basename $$i` ; \
619 done; \
620 for i in `find . -type f ! -path './release/*' -name '*.7'`; do \
621 $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man7/`basename $$i` ; \
622 done
623
624 install-ldif:
625 @$(MKDIRP) $(DESTDIR)$(datarootdir)/cygwin
626 $(INSTALL_DATA) $(srcdir)/cygwin.ldif $(DESTDIR)$(datarootdir)/cygwin
627
628 install_target:
629
630 uninstall-libs: $(TARGET_LIBS)
631 rm -f $(bindir)/$(DLL_NAME); \
632 for i in $^; do \
633 rm -f $(tooldir)/lib/$$i ; \
634 done
635
636 uninstall-headers:
637 cd $(srcdir); \
638 for sub in `find include -name '[a-z]*' -type d -print | sort`; do \
639 for i in $$sub/*.h ; do \
640 rm -f $(tooldir)/$$sub/`basename $$i` ; \
641 done ; \
642 done ; \
643
644 uninstall-man:
645 cd $(srcdir); \
646 for i in `find . -type f -name '*.2'`; do \
647 rm -f $(DESTDIR)$(mandir)/man2/`basename $$i` ; \
648 done; \
649 for i in `find . -type f -name '*.3'`; do \
650 rm -f $(DESTDIR)$(mandir)/man3/`basename $$i` ; \
651 done; \
652 for i in `find . -type f -name '*.5'`; do \
653 rm -f $(DESTDIR)$(mandir)/man5/`basename $$i` ; \
654 done; \
655 for i in `find . -type f -name '*.7'`; do \
656 rm -f $(DESTDIR)$(mandir)/man7/`basename $$i` ; \
657 done
658
659 clean distclean realclean:
660 -rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc *.exe *.d \
661 *stamp* *_magic.h sigfe.s cygwin.def cygwin.map cygwin.sc \
662 globals.h localtime.patched.c
663 -@$(MAKE) -C ${cygserver_blddir} libclean
664
665 maintainer-clean: clean
666 @echo "This command is intended for maintainers to use;"
667 @echo "it deletes files that may require special tools to rebuild."
668 -rm -fr configure
669 -rm -f $(srcdir)/$(TLSOFFSETS_H) $(srcdir)/devices.cc
670
671 # Rule to build LDSCRIPT
672 $(LDSCRIPT): $(LDSCRIPT).in
673 $(CC) -E - -P < $^ -o $@
674
675 # Rule to build cygwin.dll
676 $(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(LIBSERVER) $(LIBC) $(LIBM) $(API_VER) Makefile $(VERSION_OFILES)
677 $(CXX) $(CXXFLAGS) \
678 -mno-use-libstdc-wrappers \
679 -Wl,--gc-sections -nostdlib -Wl,-T$(firstword $^) -static \
680 -Wl,--heap=0 -Wl,--out-implib,cygdll.a -shared -o $@ \
681 -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) $(VERSION_OFILES) \
682 $(MALLOC_OBJ) $(LIBSERVER) $(LIBM) $(LIBC) \
683 -lgcc $(DLL_IMPORTS) -Wl,-Map,cygwin.map
684 @$(word 2,$^) $(OBJDUMP) $(OBJCOPY) $@ ${patsubst %0.dll,%1.dbg,$@}
685 @ln -f $@ new-$(DLL_NAME)
686
687 # Rule to build libcygwin.a
688 $(LIB_NAME): $(DEF_FILE) $(LIBCOS) | $(TEST_DLL_NAME)
689 ${srcdir}/mkimport ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $(wordlist 2,99,$^)
690
691 ${STATIC_LIB_NAME}: mkstatic ${TEST_DLL_NAME}
692 perl -d $< -x ${EXCLUDE_STATIC_OFILES} --library=${LIBC} --library=${LIBM} --ar=${AR} $@ cygwin.map
693
694 # Rule to make stub library used by testsuite
695 # dependency set to $(LIB_NAME) to accommodate make -j2.
696 $(TEST_LIB_NAME): $(LIB_NAME)
697 perl -p -e 'BEGIN{binmode(STDIN); binmode(STDOUT);}; s/cygwin1/cygwin0/g' < $? > $@
698
699 $(LIBSERVER): ${cygserver_blddir}/Makefile
700 $(MAKE) -C ${cygserver_blddir} libcygserver.a
701
702 ${cygserver_blddir}/Makefile:
703 /bin/mkdir -p ${@D}
704 cd ${@D} && exec /bin/sh $(dir ${srcdir})/cygserver/configure ${configure_args}
705
706 dll_ofiles: $(DLL_OFILES)
707
708 $(LIBGMON_A): $(GMON_OFILES) $(GMON_START)
709 $(AR) rcv $(LIBGMON_A) $(GMON_OFILES)
710
711 globals.h: mkglobals_h globals.cc
712 $^ > $@
713
714 ${DLL_OFILES} ${LIBCOS}: globals.h $(srcdir)/$(TLSOFFSETS_H)
715
716 shared_info_magic.h: cygmagic shared_info.h
717 /bin/sh $(word 1,$^) $@ "${COMPILE.cc} -E -x c++" $(word 2,$^) SHARED_MAGIC 'class shared_info' USER_MAGIC 'class user_info'
718
719 child_info_magic.h: cygmagic child_info.h
720 /bin/sh $(word 1,$^) $@ "${COMPILE.cc} -E -x c++" $(word 2,$^) CHILD_INFO_MAGIC 'class child_info'
721
722 dcrt0.o sigproc.o: child_info_magic.h
723
724 shared.o: shared_info_magic.h
725
726 localtime.patched.c: tzcode/localtime.c tzcode/localtime.c.patch
727 patch -u -o localtime.patched.c \
728 $(srcdir)/tzcode/localtime.c \
729 $(srcdir)/tzcode/localtime.c.patch
730
731 localtime.o: tzcode/localtime_wrapper.c localtime.patched.c
732 $(CC) ${COMMON_CFLAGS} ${localtime_CFLAGS} \
733 -I$(target_builddir)/winsup/cygwin \
734 -I$(srcdir) -I$(srcdir)/tzcode -c -o $@ $<
735
736 $(srcdir)/devices.cc: gendevices devices.in devices.h
737 ${wordlist 1,2,$^} $@
738
739 ${CURDIR}/libc.a: ${LIB_NAME} ${CURDIR}/libm.a libpthread.a libutil.a
740 ${speclib} -v ${@F}
741
742 ${CURDIR}/libm.a: ${LIB_NAME} $(LIBM) $(MATH_OFILES)
743 ${speclib} ${@F}
744
745 libpthread.a: ${LIB_NAME} pthread.o thread.o call_once.o cnd.o mtx.o \
746 thrd.o tss.o
747 ${speclib} ${@F}
748
749 libutil.a: ${LIB_NAME} bsdlib.o
750 ${speclib} ${@F}
751
752 libdl.a: ${LIB_NAME} dlfcn.o
753 ${speclib} ${@F}
754
755 libresolv.a: ${LIB_NAME} minires.o
756 ${speclib} ${@F}
757
758 librt.a: ${LIB_NAME} posix_ipc.o
759 ${speclib} ${@F}
760
761 libacl.a: ${LIB_NAME} sec_posixacl.o
762 ${speclib} ${@F}
763
764 libssp.a: ${LIB_NAME} $(newlib_build)/libc/ssp/lib.a
765 ${speclib} ${@F}
766
767 ${EXTRALIBS}: lib%.a: %.o
768 $(AR) cru $@ $?
769
770 # Every time we touch a source file, the version info has to be rebuilt
771 # to maintain a correct build date, especially in uname release output
772 find_src_files = $(wildcard $(dir)/*.[chS]) $(wildcard $(dir)/*.cc)
773 src_files := $(foreach dir,$(VPATH),$(find_src_files))
774
775 # mkvers.sh creates version.cc in the first place, winver.o always
776 # second, so version.cc is always older than winver.o
777 version.cc: mkvers.sh include/cygwin/version.h winver.rc $(src_files)
778 @echo "Making version.cc and winver.o";\
779 /bin/sh ${word 1,$^} ${word 2,$^} ${word 3,$^} $(WINDRES) ${CFLAGS} -I${srcdir}/include
780 $(VERSION_OFILES): version.cc
781
782 Makefile: ${srcdir}/Makefile.in
783 /bin/sh ./config.status
784
785 $(DEF_FILE) sigfe.s: gendef $(srcdir)/$(TLSOFFSETS_H) $(DIN_FILE)
786 $(word 1,$^) --cpu=${target_cpu} --output-def=$(DEF_FILE) --tlsoffsets=$(word 2,$^) $(wordlist 3,4,$^)
787
788 $(srcdir)/$(TLSOFFSETS_H): gentls_offsets cygtls.h
789 $^ $@ $(target_cpu) $(COMPILE.cc) -c || rm $@
790
791 sigfe.s: $(DEF_FILE)
792
793 sigfe.o: sigfe.s $(srcdir)/$(TLSOFFSETS_H)
794 $(CC) ${CFLAGS} -c -o $@ $<
795
796 ctags: CTAGS
797 tags: CTAGS
798 CTAGS:
799 -cd $(srcdir) && \
800 ctags -R --c++-kinds=+p --fields=+iaS --extra=+q \
801 --regex-C++='/EXPORT_ALIAS *\([a-zA-Z0-9_]*, *([a-zA-Z0-9_]*)\)/\1/' \
802 --regex-C++='/__ASMNAME *\("([a-zA-Z0-9_]+)"\)/\1/' \
803 .
804
805 deps:=${wildcard *.d}
806 ifneq (,$(deps))
807 include $(deps)
808 endif
809
810 %: RCS/%,v
This page took 0.074372 seconds and 5 git commands to generate.