Added standard makefile targets, including distclean, dist, install-strip. Removed no-lib recipe because there's a proper dependency rule
parent
7b629dcfa6
commit
123ca9b76d
51
GNUmakefile
51
GNUmakefile
|
|
@ -31,9 +31,9 @@ ifeq ($(PREFIX),)
|
||||||
PREFIX = /usr
|
PREFIX = /usr
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Sadly, we can't actually use GCC_PRAGMA_AWARE with GCC because of GCC bug 53431.
|
# Sadly, we can't actually use GCC_PRAGMA_AWARE with GCC because of GCC Bug 53431.
|
||||||
# Its a shame because GCC has so much to offer by the way of analysis. Clang works
|
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431). Its a shame because GCC has
|
||||||
# as expected, though. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
|
# so much to offer by the way of analysis. Clang works as expected, though.
|
||||||
ifneq ($(CLANG_COMPILER),0)
|
ifneq ($(CLANG_COMPILER),0)
|
||||||
CXXFLAGS += -Wall
|
CXXFLAGS += -Wall
|
||||||
endif
|
endif
|
||||||
|
|
@ -211,20 +211,30 @@ LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o)
|
||||||
TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o)
|
TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o)
|
||||||
DLLTESTOBJS = dlltest.dllonly.o
|
DLLTESTOBJS = dlltest.dllonly.o
|
||||||
|
|
||||||
all: cryptest.exe
|
# For various targets, see https://www.gnu.org/prep/standards/html_node/Standard-Targets.html
|
||||||
|
# We want to include libcryptopp, cryptest, clean, distclean, install, install-strip, uninstall
|
||||||
|
|
||||||
|
all cryptest: cryptest.exe
|
||||||
static: libcryptopp.a
|
static: libcryptopp.a
|
||||||
dynamic: libcryptopp.so
|
shared dynamic: libcryptopp.so
|
||||||
|
|
||||||
asan ubsan: libcryptopp.a cryptest.exe
|
asan ubsan: libcryptopp.a cryptest.exe
|
||||||
|
|
||||||
test: cryptest.exe
|
.PHONY: test check
|
||||||
|
test check: cryptest.exe
|
||||||
./cryptest.exe v
|
./cryptest.exe v
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
-$(RM) cryptest.exe libcryptopp.a libcryptopp.so GNUmakefile.deps $(LIBOBJS) $(TESTOBJS) cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe dlltest.exe $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTI MPORTOBJS) $(DLLTESTOBJS)
|
-$(RM) cryptest.exe libcryptopp.a libcrypto++.a libcryptopp.so libcrypto++.so $(LIBOBJS) $(TESTOBJS) cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe dlltest.exe $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTI MPORTOBJS) $(DLLTESTOBJS)
|
||||||
-$(RM) -r cryptest.exe.dSYM
|
-$(RM) -r cryptest.exe.dSYM
|
||||||
|
|
||||||
|
.PHONY: distclean
|
||||||
|
distclean:
|
||||||
|
-$(RM) -r GNUmakefile.deps *.o *.obj *.a *.so *.exe a.out \
|
||||||
|
adhoc.cpp adhoc.cpp.copied *.diff *.patch cryptopp.zip \
|
||||||
|
*.dSYM .DS_Store TestVectors/.DS_Store TestData/.DS_Store
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install:
|
install:
|
||||||
$(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin
|
$(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin
|
||||||
|
|
@ -233,13 +243,32 @@ install:
|
||||||
-$(CP) *.so $(PREFIX)/lib
|
-$(CP) *.so $(PREFIX)/lib
|
||||||
-$(CP) *.exe $(PREFIX)/bin
|
-$(CP) *.exe $(PREFIX)/bin
|
||||||
|
|
||||||
.PHONY: remove
|
.PHONY: install-strip
|
||||||
remove:
|
install-strip: libcryptopp.a cryptest.exe
|
||||||
|
$(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
|
||||||
|
-$(STRIP) -s $(PREFIX)/bin/cryptest.exe
|
||||||
|
-$(STRIP) -s $(PREFIX)/lib/libcryptopp.so
|
||||||
|
|
||||||
|
.PHONY: uninstall remove
|
||||||
|
uninstall remove:
|
||||||
-$(RM) -rf $(PREFIX)/include/cryptopp
|
-$(RM) -rf $(PREFIX)/include/cryptopp
|
||||||
-$(RM) $(PREFIX)/lib/libcryptopp.a
|
-$(RM) $(PREFIX)/lib/libcryptopp.a
|
||||||
-$(RM) $(PREFIX)/lib/libcryptopp.so
|
-$(RM) $(PREFIX)/lib/libcryptopp.so
|
||||||
-$(RM) $(PREFIX)/bin/cryptest.exe
|
-$(RM) $(PREFIX)/bin/cryptest.exe
|
||||||
|
|
||||||
|
.PHONY: dist
|
||||||
|
dist: distclean
|
||||||
|
-zip -9 cryptopp.zip *.h *.cpp *.asm License.txt Readme.txt \
|
||||||
|
GNUmakefile GNUmakefile-cross Doxyfile \
|
||||||
|
cryptest_bds.bdsgroup cryptest_bds.bdsproj cryptest_bds.bpf cryptlib_bds.bdsproj \
|
||||||
|
cryptest.sln cryptest.dsp cryptest.dsw cryptest.vcproj \
|
||||||
|
dlltest.dsp dlltest.vcproj cryptlib.dsp cryptlib.vcproj cryptopp.rc \
|
||||||
|
TestVectors/*.txt TestVectors/*.dat TestData/*.txt TestData/*.dat
|
||||||
|
|
||||||
libcryptopp.a: $(LIBOBJS)
|
libcryptopp.a: $(LIBOBJS)
|
||||||
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
@ -250,9 +279,6 @@ libcryptopp.so: $(LIBOBJS)
|
||||||
cryptest.exe: libcryptopp.a $(TESTOBJS)
|
cryptest.exe: libcryptopp.a $(TESTOBJS)
|
||||||
$(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
|
$(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
|
||||||
|
|
||||||
nolib: $(OBJS) # makes it faster to test changes
|
|
||||||
$(CXX) -o ct $(CXXFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS)
|
|
||||||
|
|
||||||
dll: cryptest.import.exe dlltest.exe
|
dll: cryptest.import.exe dlltest.exe
|
||||||
|
|
||||||
cryptopp.dll: $(DLLOBJS)
|
cryptopp.dll: $(DLLOBJS)
|
||||||
|
|
@ -298,4 +324,3 @@ endif
|
||||||
GNUmakefile.deps:
|
GNUmakefile.deps:
|
||||||
$(CXX) $(CXXFLAGS) -MM *.cpp > GNUmakefile.deps
|
$(CXX) $(CXXFLAGS) -MM *.cpp > GNUmakefile.deps
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue