This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2 6/8] Update Makefile


---
 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]