diff options
Diffstat (limited to 'extra/crypto++/GNUmakefile.parabola')
-rw-r--r-- | extra/crypto++/GNUmakefile.parabola | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/extra/crypto++/GNUmakefile.parabola b/extra/crypto++/GNUmakefile.parabola new file mode 100644 index 000000000..22a724961 --- /dev/null +++ b/extra/crypto++/GNUmakefile.parabola @@ -0,0 +1,94 @@ +# -*- makefile -*- + +CXXFLAGS += -DNDEBUG -fPIC +# the following options reduce code size, but breaks link or makes link very slow on some systems +CXXFLAGS += -ffunction-sections -fdata-sections +LDFLAGS += -Wl,--gc-sections +ARFLAGS = -cr # ar needs the dash on OpenBSD +RANLIB = ranlib +CP = cp +MKDIR = mkdir +EGREP = egrep + +# Default prefix for make install +PREFIX ?= /usr + +LDFLAGS += -pthread + +SRCS = $(wildcard *.cpp) +ifeq ($(SRCS),) # workaround wildcard function bug in GNU Make 3.77 +SRCS = $(shell echo *.cpp) +endif + +OBJS = $(SRCS:.cpp=.o) +# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?) +TESTOBJS = bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o +LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS)) + +DLLSRCS = algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp cryptlib.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp +DLLOBJS = $(DLLSRCS:.cpp=.export.o) +LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o) +TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o) +DLLTESTOBJS = dlltest.dllonly.o + +all: cryptest.exe + +test: cryptest.exe + ./cryptest.exe v + +clean: + $(RM) cryptest.exe libcryptopp.a $(LIBOBJS) $(TESTOBJS) cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe dlltest.exe $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS) + +install: + $(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin + $(CP) *.h $(PREFIX)/include/cryptopp + $(CP) *.a $(PREFIX)/lib + $(CP) *.so $(PREFIX)/lib + $(CP) *.exe $(PREFIX)/bin + +libcryptopp.a: $(LIBOBJS) + $(AR) $(ARFLAGS) $@ $(LIBOBJS) + $(RANLIB) $@ + +libcryptopp.so: $(LIBOBJS) + $(CXX) -shared -o $@ $(LIBOBJS) + +cryptest.exe: libcryptopp.a $(TESTOBJS) + $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) -L. -lcryptopp $(LDFLAGS) $(LDLIBS) + +nolib: $(OBJS) # makes it faster to test changes + $(CXX) -o ct $(CXXFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS) + +dll: cryptest.import.exe dlltest.exe + +cryptopp.dll: $(DLLOBJS) + $(CXX) -shared -o $@ $(CXXFLAGS) $(DLLOBJS) $(LDFLAGS) $(LDLIBS) -Wl,--out-implib=libcryptopp.dll.a + +libcryptopp.import.a: $(LIBIMPORTOBJS) + $(AR) $(ARFLAGS) $@ $(LIBIMPORTOBJS) + $(RANLIB) $@ + +cryptest.import.exe: cryptopp.dll libcryptopp.import.a $(TESTIMPORTOBJS) + $(CXX) -o $@ $(CXXFLAGS) $(TESTIMPORTOBJS) -L. -lcryptopp.dll -lcryptopp.import $(LDFLAGS) $(LDLIBS) + +dlltest.exe: cryptopp.dll $(DLLTESTOBJS) + $(CXX) -o $@ $(CXXFLAGS) $(DLLTESTOBJS) -L. -lcryptopp.dll $(LDFLAGS) $(LDLIBS) + +adhoc.cpp: adhoc.cpp.proto +ifeq ($(wildcard adhoc.cpp),) + cp adhoc.cpp.proto adhoc.cpp +else + touch adhoc.cpp +endif + +%.dllonly.o : %.cpp + $(CXX) $(CXXFLAGS) -DCRYPTOPP_DLL_ONLY -c $< -o $@ + +%.import.o : %.cpp + $(CXX) $(CXXFLAGS) -DCRYPTOPP_IMPORTS -c $< -o $@ + +%.export.o : %.cpp + $(CXX) $(CXXFLAGS) -DCRYPTOPP_EXPORTS -c $< -o $@ + +%.o : %.cpp + $(CXX) $(CXXFLAGS) -c $< |