public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Yaakov Selkowitz <yselkowi@redhat.com>
To: cygwin-apps@cygwin.com
Subject: [PATCH crypt 6/8] Update Makefile
Date: Fri, 04 Aug 2017 03:02:00 -0000	[thread overview]
Message-ID: <20170804025258.19248-7-yselkowi@redhat.com> (raw)
In-Reply-To: <20170804025258.19248-1-yselkowi@redhat.com>

---
 Makefile | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index e1bb705..f770189 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@
 CC ?= gcc
 AR ?= ar
 CFLAGS ?= -g -O2
+CPPFLAGS = -I. -D_GNU_SOURCE
 
 prefix:=/usr
 bindir=$(prefix)/bin
@@ -9,41 +10,40 @@ libdir=$(prefix)/lib
 incdir=$(prefix)/include
 docdir=$(prefix)/share/doc/Cygwin
 DLLVER=0
-EXE=.exe
 
 STATICLIB=libcrypt.a
 SHAREDLIB=cygcrypt-$(DLLVER).dll
 IMPORTLIB=libcrypt.dll.a
 
-APPS=crypt$(EXE)
 LIBS=$(STATICLIB) $(SHAREDLIB)
 
-all: $(APPS) $(LIBS)
+SRCS=crypt.c crypt_des.c crypt_md5.c crypt_r.c \
+     crypt_sha256.c crypt_sha512.c encrypt.c
+OBJS=$(SRCS:.c=.o)
 
-crypt$(EXE): crypt.o $(LIBS)
-	$(CC) -o $@ crypt.o -L. -lcrypt
+all: $(LIBS)
 
-$(STATICLIB): encrypt.o
-	$(AR) rv $@ encrypt.o
+$(STATICLIB): $(OBJS)
+	$(AR) rv $@ $^
 
-$(SHAREDLIB): encrypt.o
-	$(CC) -shared -Wl,--gc-sections -Wl,--out-implib=$(IMPORTLIB) crypt.def \
-	$^ -o $@
+$(SHAREDLIB): $(OBJS) crypt.def
+	$(CC) -shared -Wl,--gc-sections -Wl,--out-implib=$(IMPORTLIB) $^ -o $@
 
-encrypt.o: encrypt.h
+crypt.o: crypt.h
+
+crypt_r.o: crypt.h
 
 distclean: clean
 
 clean:
-	-rm *.o *.exe *.a *.dll
+	-rm *.o *.a *.dll
 
 install: all
 	install -d $(DESTDIR)$(bindir)
 	install -d $(DESTDIR)$(libdir)
 	install -d $(DESTDIR)$(incdir)
 	install -d $(DESTDIR)$(docdir)
-	install -m 755 $(APPS)         $(DESTDIR)$(bindir)
-	install -m 644 encrypt.h       $(DESTDIR)$(incdir)/crypt.h
+	install -m 644 crypt.h         $(DESTDIR)$(incdir)/crypt.h
 	install -m 644 $(STATICLIB)    $(DESTDIR)$(libdir)
 	install -m 644 $(IMPORTLIB)    $(DESTDIR)$(libdir)
 	install -m 755 $(SHAREDLIB)    $(DESTDIR)$(bindir)
-- 
2.13.2

  parent reply	other threads:[~2017-08-04  3:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04  2:53 [PATCH crypt 0/8] Use musl implementation Yaakov Selkowitz
2017-08-04  2:53 ` [PATCH crypt 2/8] Port sources to Cygwin Yaakov Selkowitz
2017-08-04  2:53 ` [PATCH crypt 1/8] Import musl sources Yaakov Selkowitz
2017-08-04  2:53 ` [PATCH crypt 3/8] Export crypt_r Yaakov Selkowitz
2017-08-04  2:58 ` [PATCH crypt 4/8] Guard GNU extensions in header, declare other functions Yaakov Selkowitz
2017-08-04  2:58 ` [PATCH crypt 7/8] Update README Yaakov Selkowitz
2017-08-04  2:58 ` [PATCH crypt 8/8] Add .gitignore Yaakov Selkowitz
2017-08-04  3:01 ` [PATCH crypt 5/8] Disable blowfish cipher Yaakov Selkowitz
2017-08-04  7:46   ` Corinna Vinschen
2017-08-04  8:32     ` Yaakov Selkowitz
2017-09-01  1:38       ` Yaakov Selkowitz
2017-08-04  3:02 ` Yaakov Selkowitz [this message]
2017-09-01  1:40   ` [PATCH v2 6/8] Update Makefile Yaakov Selkowitz
2017-09-01  9:03     ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170804025258.19248-7-yselkowi@redhat.com \
    --to=yselkowi@redhat.com \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).