| 1 |
# extension/Makefile for the MinGW build |
| 2 |
# |
| 3 |
# Copyright (C) 2013, 2015, 2017, 2023 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
# This Makefile.in is free software; the Free Software Foundation |
| 6 |
# gives unlimited permission to copy and/or distribute it, |
| 7 |
# with or without modifications, as long as this notice is preserved. |
| 8 |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
| 11 |
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 12 |
# PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
prefix = c:/gnu |
| 15 |
pkgdatadir = $(prefix)/lib/awk |
| 16 |
pkgextensiondir = $(prefix)/lib/gawk |
| 17 |
includedir = $(prefix)/include |
| 18 |
libdir = $(prefix)/lib |
| 19 |
datadir = $(prefix)/share |
| 20 |
pkgdatadir = $(datadir)/gawk-extensions |
| 21 |
pkgincludedir = $(includedir)/gawk-extensions |
| 22 |
pkglibdir = $(libdir)/gawk-extensions |
| 23 |
pkglibexecdir = $(libexecdir)/gawk-extensions |
| 24 |
|
| 25 |
SOEXT = dll |
| 26 |
|
| 27 |
MPFR = -DHAVE_MPFR |
| 28 |
MPFR_LIBS = -lmpfr -lgmp |
| 29 |
|
| 30 |
SIMPLE_EXTENSIONS = inplace.$(SOEXT) ordchr.$(SOEXT) readfile.$(SOEXT)\ |
| 31 |
revoutput.$(SOEXT) revtwoway.$(SOEXT) testext.$(SOEXT) |
| 32 |
ALL_EXTENSIONS = filefuncs.$(SOEXT) fnmatch.$(SOEXT) inplace.$(SOEXT)\ |
| 33 |
intdiv.$(SOEXT) ordchr.$(SOEXT) readdir.$(SOEXT) readfile.$(SOEXT) \ |
| 34 |
revoutput.$(SOEXT) revtwoway.$(SOEXT) rwarray.$(SOEXT) \ |
| 35 |
testext.$(SOEXT) time.$(SOEXT) |
| 36 |
|
| 37 |
extensions: $(ALL_EXTENSIONS) |
| 38 |
|
| 39 |
fnmatch.$(SOEXT): fnmatch.c |
| 40 |
gcc -I.. -I../missing_d -DHAVE_FNMATCH_H -shared -gdwarf-2 -g3 -static-libgcc -o $@ fnmatch.c |
| 41 |
|
| 42 |
intdiv.$(SOEXT): intdiv.c |
| 43 |
gcc -I.. $(MPFR) -shared -gdwarf-2 -g3 -static-libgcc -o $@ intdiv.c $(MPFR_LIBS) |
| 44 |
|
| 45 |
readdir.$(SOEXT): readdir.c gawkdirfd.h |
| 46 |
gcc -I.. -DHAVE_DIRENT_H -shared -gdwarf-2 -g3 -static-libgcc -o $@ readdir.c |
| 47 |
|
| 48 |
rwarray.$(SOEXT): rwarray.c |
| 49 |
gcc -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ rwarray.c -lws2_32 |
| 50 |
|
| 51 |
filefuncs.$(SOEXT): filefuncs.c stack.c stack.h gawkfts.h |
| 52 |
gcc -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ filefuncs.c stack.c |
| 53 |
|
| 54 |
time.$(SOEXT): time.c |
| 55 |
gcc -DHAVE_GETSYSTEMTIMEASFILETIME -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ time.c |
| 56 |
|
| 57 |
$(SIMPLE_EXTENSIONS): |
| 58 |
gcc -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ $(@:.$(SOEXT)=.c) |
| 59 |
|
| 60 |
$(ALL_EXTENSIONS): ../gawkapi.h ../gettext.h |
| 61 |
|
| 62 |
inplace.$(SOEXT): inplace.c |
| 63 |
ordchr.$(SOEXT): ordchr.c |
| 64 |
readfile.$(SOEXT): readfile.c |
| 65 |
revoutput.$(SOEXT): revoutput.c |
| 66 |
rwarray.$(SOEXT): rwarray.c |
| 67 |
testext.$(SOEXT): testext.c |
| 68 |
time.$(SOEXT): time.c |
| 69 |
|
| 70 |
# This must not be called 'install' because there's a file INSTALL, |
| 71 |
# and case-insensitive filesystems will gladly accept it. |
| 72 |
install-extensions: |
| 73 |
-mkdir "$(pkgextensiondir)" |
| 74 |
cp *.$(SOEXT) "$(pkgextensiondir)" |
| 75 |
-mkdir "$(prefix)/share/man/man3" |
| 76 |
cp *.3am "$(prefix)/share/man/man3" |
| 77 |
|
| 78 |
install-strip: install-extensions |
| 79 |
strip --strip-unneeded "$(pkgextensiondir)"/*.$(SOEXT) |
| 80 |
|
| 81 |
clean: |
| 82 |
-rm -f *.$(SOEXT) |
| 83 |
|