The MinGW.org Windows System Libraries
Revision | e67de2a9321dd80e1c4566e7fbcb89573484fdb5 (tree) |
---|---|
Time | 2012-08-16 04:47:13 |
Author | Earnie Boyd <earnie@user...> |
Commiter | Earnie Boyd |
Add the winapi libraries and install the historical documents.
@@ -18,7 +18,9 @@ CFLAGS=@CFLAGS@ | ||
18 | 18 | RANLIB=@RANLIB@ |
19 | 19 | AS=@AS@ |
20 | 20 | DLLTOOL=@DLLTOOL@ |
21 | +DLLTOOL_FLAGS := --as $(AS) -k -U --dllname | |
21 | 22 | INSTALL=@INSTALL@ |
23 | +MKDIR_P=@MKDIR_P@ | |
22 | 24 | |
23 | 25 | INCLUDES=-I$(top_srcdir)/include -I$(srcdir)/include \ |
24 | 26 | -I$(top_srcdir)/src/libcrt/include -nostdinc \ |
@@ -27,7 +29,7 @@ ALL_CFLAGS=$(CFLAGS) $(INCLUDES) -DNTDDI_VERSION=0x04000000 | ||
27 | 29 | |
28 | 30 | .SUFFIXES: .def.in .def |
29 | 31 | |
30 | -lib_LIBRARIES = \ | |
32 | +mingwrt_lib_LIBRARIES = \ | |
31 | 33 | libmsvcrt.a \ |
32 | 34 | libmsvcrtd.a \ |
33 | 35 | libmsvcr70.a \ |
@@ -59,6 +61,14 @@ lib_LIBRARIES = \ | ||
59 | 61 | libmingwex.a \ |
60 | 62 | libgmon.a |
61 | 63 | |
64 | +winapi_DEF := $(notdir $(wildcard ${top_srcdir}/lib/lib32/*.def)) | |
65 | +winapi_MRI := $(notdir $(wildcard ${top_srcdir}/lib/lib32/*.mri)) | |
66 | +winapi_lib_LIBRARIES := $(addprefix lib,$(winapi_DEF:.def=.a)) | |
67 | +winapi_mri_LIBRARIES := $(addprefix lib,$(winapi_MRI:.mri=.a)) | |
68 | +winapi_lib_EXTRA_LIBRARIES := libuuid.a libscrnsave.a libscrnsavw.a liblargeint.a | |
69 | + | |
70 | +lib_LIBRARIES := $(mingwrt_lib_LIBRARIES) $(winapi_lib_LIBRARIES) $(winapi_lib_EXTRA_LIBRARIES) $(winapi_mri_LIBRARIES) | |
71 | + | |
62 | 72 | SRCDIR := src/libcrt/crt |
63 | 73 | crt0_SOURCES := \ |
64 | 74 | $(SRCDIR)/crt1.c \ |
@@ -99,6 +109,21 @@ lib_OBJECTS := $(crt0_OBJECTS) $(gcrt0_OBJECTS) | ||
99 | 109 | |
100 | 110 | bin_LIBRARIES := mingwm10.dll |
101 | 111 | doc_DOCUMENTS := README LICENSE |
112 | +doc_DOCUMENTS_EXTRA := doc/historical/mingw doc/historical/w32api | |
113 | + | |
114 | +libuuid_a_SOURCES := $(addprefix src/libuuid/,$(notdir $(wildcard ${top_srcdir}/src/libuuid/*.c))) | |
115 | +libuuid_a_OBJECTS := $(libuuid_a_SOURCES:.c=.o) | |
116 | + | |
117 | +libscrnsave_a_SOURCES := src/libscrnsave/scrnsave.c | |
118 | +libscrnsave_a_OBJECTS := $(libscrnsave_a_SOURCES:.c=.o) | |
119 | +scrnsave_o_CFLAGS := -UUNICODE | |
120 | + | |
121 | +libscrnsavw_a_SOURCES := src/libscrnsave/scrnsave.c | |
122 | +libscrnsavw_a_OBJECTS := src/libscrnsave/srcnsavw.o | |
123 | +scrnsavw_o_CFLAGS := -DUNICODE | |
124 | + | |
125 | +liblargeint_a_SOURCES := src/liblargeint/largeint.c | |
126 | +liblargeint_a_OBJECTS := $(liblargeint_a_SOURCES:.c=.o) | |
102 | 127 | |
103 | 128 | msvcrt_DEF = \ |
104 | 129 | msvcrt.def \ |
@@ -566,27 +591,48 @@ $(moldname_DEF): lib/lib32/moldname.def.in | ||
566 | 591 | -D__MSVCRT__ -C -E -P -xc-header \ |
567 | 592 | $? > $@ |
568 | 593 | |
594 | +SRCDIR := lib/lib32 | |
595 | +$(notdir $(winapi_lib_LIBRARIES)): $(addprefix lib/lib32/,$(winapi_DEF)) | |
596 | + @echo Making library $@ from $<. | |
597 | + DLLNAME=$(notdir $(<:.def=.dll)) | |
598 | + $(DLLTOOL) $(DLLTOOL_FLAGS) $${DLLNAME} --def $< --output-lib $@ | |
599 | + $(RANLIB) $@ | |
600 | + | |
601 | +$(notdir $(winapi_mri_LIBRARIES)): $(addprefix lib/lib32/,$(winapi_MRI)) | |
602 | + @echo Making library $@ from $<. | |
603 | + $(AR) -M < $< | |
604 | + $(RANLIB) $@ | |
605 | + | |
569 | 606 | lib%.a: %.def |
570 | 607 | @echo Making library $@ from $?. |
571 | 608 | N=`echo $@ | sed -e 's|lib\([a-z]*\)\([0-9]*\).*|\1|'`; \ |
572 | 609 | V=`echo $@ | sed -e 's|lib\([a-z]*\)\([0-9]*\).*|\2|'`; \ |
573 | 610 | DLLNAME="$${N}$${V}.dll"; \ |
574 | - $(DLLTOOL) --as $(AS) -k -U --dllname $${DLLNAME} --def $< --output-lib $@ | |
611 | + $(DLLTOOL) $(DLLTOOL_FLAGS) $${DLLNAME} --def $< --output-lib $@ | |
575 | 612 | $(RANLIB) $@ |
576 | 613 | |
577 | 614 | %.o : %.c |
578 | - mkdir -p $(@D) | |
615 | + $(MKDIR_P) $(@D) | |
579 | 616 | $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $< |
580 | 617 | |
581 | 618 | SRCDIR := src/libcrt/crt |
582 | 619 | $(SRCDIR)/crt1.o $(SRCDIR)/dllcrt1.o: |
583 | - mkdir -p $(@D) | |
620 | + $(MKDIR_P) $(@D) | |
584 | 621 | $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -U__MSVCRT__ -D__CRTDLL__ -o $@ $< |
585 | 622 | |
586 | 623 | $(SRCDIR)/crt2.o $(SRCDIR)/dllcrt2.o: |
587 | - mkdir -p $(@D) | |
624 | + $(MKDIR_P) $(@D) | |
588 | 625 | $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -D__MSVCRT__ -U__CRTDLL__ -o $@ $< |
589 | 626 | |
627 | +SRCDIR := src/libscrnsave | |
628 | +$(libscrnsave_a_OBJECTS): $(libscrnsave_a_SOURCES) | |
629 | + $(MKDIR_P) $(@D) | |
630 | + $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(scrnsave_o_CFLAGS) -o $@ $< | |
631 | + | |
632 | +$(libscrnsavw_a_OBJECTS): $(libscrnsavw_a_SOURCES) | |
633 | + $(MKDIR_P) $(@D) | |
634 | + $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(scrnsavw_o_CFLAGS) -o $@ $< | |
635 | + | |
590 | 636 | $(SRCDIR)/crt1.o: $(SRCDIR)/crt1.c |
591 | 637 | $(SRCDIR)/dllcrt1.o: $(SRCDIR)/dllcrt1.c |
592 | 638 | $(SRCDIR)/crt2.o: $(SRCDIR)/crt1.c |
@@ -616,7 +662,7 @@ libmingwthrd.a: $(libmingwthrd_a_OBJECTS) | ||
616 | 662 | $(RANLIB) $@ |
617 | 663 | |
618 | 664 | libmingwthrd_old.a: $(libmingwthrd_a_OBJECTS) mingwm10.dll mingwthrd.def |
619 | - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname mingwm10.dll \ | |
665 | + $(DLLTOOL) $(DLLTOOL_FLAGS) mingwm10.dll \ | |
620 | 666 | --def mingwthrd.def --output-lib $@ |
621 | 667 | $(AR) rc $@ $(libmingwthrd_a_OBJECTS) |
622 | 668 | $(RANLIB) $@ |
@@ -625,6 +671,22 @@ libgmon.a: $(libgmon_a_OBJECTS) | ||
625 | 671 | $(AR) rc $@ $(libgmon_a_OBJECTS) |
626 | 672 | $(RANLIB) $@ |
627 | 673 | |
674 | +libuuid.a: $(libuuid_a_OBJECTS) | |
675 | + $(AR) rc $@ $(libuuid_a_OBJECTS) | |
676 | + $(RANLIB) $@ | |
677 | + | |
678 | +libscrnsave.a: $(libscrnsave_a_OBJECTS) | |
679 | + $(AR) rc $@ $(libscrnsave_a_OBJECTS) | |
680 | + $(RANLIB) $@ | |
681 | + | |
682 | +libscrnsavw.a: $(libscrnsavw_a_OBJECTS) | |
683 | + $(AR) rc $@ $(libscrnsavw_a_OBJECTS) | |
684 | + $(RANLIB) $@ | |
685 | + | |
686 | +liblargeint.a: $(liblargeint_a_OBJECTS) | |
687 | + $(AR) rc $@ $(liblargeint_a_OBJECTS) | |
688 | + $(RANLIB) $@ | |
689 | + | |
628 | 690 | _libm_dummy.c: |
629 | 691 | @echo "static int __mingw_libm_dummy;" > _libm_dummy.c |
630 | 692 |
@@ -640,7 +702,7 @@ mingwm10.dll: $(mingwm10_dll_OBJECTS) mingwthrd.def libmingwex.a | ||
640 | 702 | -o mingwm10.dll |
641 | 703 | |
642 | 704 | clean: |
643 | - rm -f *.def *.a _libm_dummy.c stamp* | |
705 | + rm -f *.def *.s *.a _libm_dummy.c stamp* | |
644 | 706 | rm -rf .deps/ |
645 | 707 | find . -type f -name \*.o -delete |
646 | 708 | find . -type f -name \*.dll -delete |
@@ -668,6 +730,10 @@ install-dirs: $(need-DESTDIR-compatibility) | ||
668 | 730 | $(mkinstalldirs) $(DESTDIR)$(bindir) |
669 | 731 | $(mkinstalldirs) $(DESTDIR)$(libdir) |
670 | 732 | $(mkinstalldirs) $(DESTDIR)$(docdir) |
733 | + $(mkinstalldirs) $(DESTDIR)$(docdir)/historical | |
734 | + $(mkinstalldirs) $(DESTDIR)$(docdir)/historical/mingw | |
735 | + $(mkinstalldirs) $(DESTDIR)$(docdir)/historical/mingw/man | |
736 | + $(mkinstalldirs) $(DESTDIR)$(docdir)/historical/w32api | |
671 | 737 | $(mkinstalldirs) $(DESTDIR)$(includedir) |
672 | 738 | for I in `find $(top_srcdir)/include/* -type d`; do \ |
673 | 739 | J=`basename $$I`; \ |
@@ -688,6 +754,7 @@ install-docs: | ||
688 | 754 | for DOC in $(doc_DOCUMENTS); do \ |
689 | 755 | $(INSTALL) $(INSTALL_FLAGS) $(top_srcdir)/$$DOC $(DESTDIR)$(docdir)/$$DOC ; \ |
690 | 756 | done |
757 | + cp -a $(top_srcdir)/doc/historical $(DESTDIR)$(docdir) ; | |
691 | 758 | |
692 | 759 | install-includes: |
693 | 760 | for INC in $(top_srcdir)/include/*.h; do \ |