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