my private gentoo overlay
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.7 KiB

--- makefile.shared.old 2013-11-11 19:07:58.870000000 +0100
+++ makefile.shared 2013-11-11 19:09:02.790000000 +0100
@@ -9,7 +9,8 @@
VERSION=0:117
# Compiler and Linker Names
-CC=libtool --mode=compile --tag=CC gcc
+LT ?= libtool
+LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
# ranlib tools
ifndef RANLIB
@@ -229,9 +230,12 @@
#The default rule for make builds the libtomcrypt library.
default:library
+%.lo: %.c
+ $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
+
#ciphers come in two flavours... enc+dec and enc
-src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
- $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
+src/ciphers/aes/aes_enc.lo: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
+ $(LTCOMPILE) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
#These are the rules to make certain object files.
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
@@ -244,38 +248,38 @@
library: $(LIBNAME)
testprof/$(LIBTEST):
- cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) make -f makefile.shared
+ cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) make -f makefile.shared
objs: $(OBJECTS)
-$(LIBNAME): $(OBJECTS) testprof/$(LIBTEST)
- libtool --silent --mode=link gcc $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
+$(LIBNAME): $(OBJECTS:.o=.lo) testprof/$(LIBTEST:.o=.lo)
+ libtool --silent --mode=link --tag CC $(CC) $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
install: $(LIBNAME)
- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
- cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install
- libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la
- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
- install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
+ install -d $(DESTDIR)$(LIBPATH)
+ cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install
+ $(LT) --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la
+ install -d $(DESTDIR)$(INCPATH)
+ install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH)
#This rule makes the hash program included with libtomcrypt
hashsum: library
- gcc $(CFLAGS) demos/hashsum.c -o hashsum.o
- gcc -o hashsum hashsum.o -ltomcrypt $(EXTRALIBS)
+ $(CC) $(CFLAGS) demos/hashsum.c -o hashsum.o
+ $(CC) -o hashsum hashsum.o -ltomcrypt $(EXTRALIBS)
#makes the crypt program
crypt: library
- gcc $(CFLAGS) demos/encrypt.c -o encrypt.o
- gcc -o crypt encrypt.o -ltomcrypt $(EXTRALIBS)
+ $(CC) $(CFLAGS) demos/encrypt.c -o encrypt.o
+ $(CC) -o crypt encrypt.o -ltomcrypt $(EXTRALIBS)
tv_gen: library $(TVS)
- gcc -o tv_gen $(TVS) -ltomcrypt $(EXTRALIBS)
+ $(CC) -o tv_gen $(TVS) -ltomcrypt $(EXTRALIBS)
test: library testprof/$(LIBTEST) $(TESTS)
- gcc -o $(TEST) $(TESTS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
+ $(CC) -o $(TEST) $(TESTS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
timing: library testprof/$(LIBTEST) $(TIMINGS)
- gcc -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
+ $(CC) -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
# $Source: /cvs/libtom/libtomcrypt/makefile.shared,v $
# $Revision: 1.80 $