This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH v2 6/8] Update Makefile
- From: Yaakov Selkowitz <yselkowi at redhat dot com>
- To: cygwin-apps at cygwin dot com
- Date: Thu, 31 Aug 2017 20:40:36 -0500
- Subject: [PATCH v2 6/8] Update Makefile
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=yselkowi at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CB99EC057FA1
- References: <20170804025258.19248-7-yselkowi@redhat.com>
---
Makefile | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile
index e1bb705..ee8d07b 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_blowfish.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.14.1