--- efence/Makefile +++ efence/Makefile @@ -27,8 +27,8 @@ endif else CURPATH=./ - CFLAGS= -g $(PIC) $(EF_OPTIONS) - CPPFLAGS= -g $(PIC) $(EF_OPTIONS) + CFLAGS+= -g $(PIC) $(EF_OPTIONS) + CXXFLAGS+= -g $(PIC) $(EF_OPTIONS) LIBS=-lpthread EFENCESO=libefence.so.0.0 endif @@ -42,7 +42,7 @@ prefix=/usr BIN_INSTALL_DIR= $(prefix)/bin LIB_INSTALL_DIR= $(prefix)/lib -MAN_INSTALL_DIR= $(prefix)/man/man3 +MAN_INSTALL_DIR= $(prefix)/share/man/man3 PACKAGE_SOURCE= README CHANGES efence.3 Makefile \ @@ -53,7 +53,9 @@ OBJECTS = efencepp.o efence.o -all: libefence.a $(EFENCESO) tstheap eftest eftestpp +all: libefence.a $(EFENCESO) + +check: tstheap eftest eftestpp @ echo "Testing Electric Fence." @ echo "After the last test, it should print that the test has PASSED." $(CURPATH)eftest @@ -61,13 +63,16 @@ @ echo "Electric Fence confidence test PASSED." install: libefence.a efence.3 libefence.so.0.0 + $(INSTALL) -d $(BIN_INSTALL_DIR) $(INSTALL) -m 755 ef.sh $(BIN_INSTALL_DIR)/ef + $(INSTALL) -d $(LIB_INSTALL_DIR) $(INSTALL) -m 644 libefence.a $(LIB_INSTALL_DIR) $(INSTALL) -m 755 libefence.so.0.0 $(LIB_INSTALL_DIR) - rm -f $(LIB_INSTALL_DIR)/libefence.so.0 ln -s libefence.so.0.0 $(LIB_INSTALL_DIR)/libefence.so.0 - rm -f $(LIB_INSTALL_DIR)/libefence.so ln -s libefence.so.0.0 $(LIB_INSTALL_DIR)/libefence.so + $(INSTALL) -d $(MAN_INSTALL_DIR) $(INSTALL) -m 644 efence.3 $(MAN_INSTALL_DIR)/efence.3 clean: @@ -93,7 +98,7 @@ ifneq ($(OS), Windows_NT) libefence.so.0.0: efence_config.h $(OBJECTS) $(CXX) -g -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \ - $(OBJECTS) -lpthread -lc + $(OBJECTS) -lpthread endif efence_config.h: createconf @@ -113,7 +118,7 @@ eftestpp: libefence.a eftestpp.o efencepp.h - rm -f eftestpp - $(CXX) $(CPPFLAGS) eftestpp.o libefence.a -o eftestpp $(LIBS) + $(CXX) $(CXXFLAGS) eftestpp.o libefence.a -o eftestpp $(LIBS) $(OBJECTS) tstheap.o eftest.o eftestpp.o: efence.h @@ -121,4 +126,4 @@ $(CC) $(CFLAGS) -c $< -o $@ .cpp.o: - $(CXX) $(CPPFLAGS) -c $< -o $@ + $(CXX) $(CXXFLAGS) -c $< -o $@