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