gcrypt-example
gcrypt-example copied to clipboard
Makefile does not work on Ubuntu
I'm using Ubuntu 15.04, and the Makefile doesn't work. Not sure if this is a Ubuntu bug or not, but Ubuntu needs the libraries included at the end of the line.
For example:
g++ -lgcrypt main.cc gcry.o -o main
is not the same as:
g++ main.cc gcry.o -lgcrypt
The first will fail, whereas the second will work.
On Ubuntu, this Makefile will work:
CXX = g++
LDFLAGS = -lgcrypt
CXXFLAGS = -std=c++11 -Wall -Wextra -g
BINS = keygen main
OBJS = gcry.o
all: $(BINS)
keygen: gcry.o
$(CXX) $(CXXFLAGS) keygen.cc $(OBJS) -o keygen $(LDFLAGS)
main: gcry.o
$(CXX) $(CXXFLAGS) main.cc $(OBJS) -o main $(LDFLAGS)
gcry.o: gcry.cc
clean:
rm -f *.o $(BINS)
Thanks for pointing this out. I've updated the repo with your makefile.