[PATCH crypt 6/8] Update Makefile
Yaakov Selkowitz
yselkowi@redhat.com
Fri Aug 4 03:02:00 GMT 2017
---
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
More information about the Cygwin-apps
mailing list