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