diff --git a/Makefile b/Makefile index 31819da..19e94de 100644 --- a/Makefile +++ b/Makefile @@ -175,6 +175,11 @@ $(OUTDIRXX)/%$(OBJ): src/%$(ASM) # other targets # ------------------------------------- +install: $(HLIB) + mkdir -p $(PREFIX)/lib $(PREFIX)/include + cp $(HLIB) $(PREFIX)/lib/ + cp inc/*.h $(PREFIX)/include/ + docs: clean: @@ -228,4 +233,4 @@ depend: init sed -e "s|\(.*\.o\)|$(CONFIGDIR)/\$$(VARIANT)/\1|g" $(CONFIGDIR)/temp.depend >> $(CONFIGDIR)/makefile.depend $(RM) $(CONFIGDIR)/temp.depend -include $(CONFIGDIR)/makefile.depend \ No newline at end of file +include $(CONFIGDIR)/makefile.depend diff --git a/configure b/configure index 1ce653d..b3208f7 100755 --- a/configure +++ b/configure @@ -14,6 +14,7 @@ asmflags='' verbose=no cxx='' cxxflags='' +prefix='/usr/local' # Parse command-line arguments while : ; do @@ -45,6 +46,8 @@ while : ; do target_abi=$flag_arg;; -os*|--os*) target_os=$flag_arg;; + --prefix*) + prefix=$flag_arg;; -h|--help|-\?|help|\?) echo "./configure [options]" echo " --cc= set the c-compiler (for example 'clang')" @@ -55,6 +58,7 @@ while : ; do echo " --asm-opts= set extra assembler options (for example '-m32')" echo " --abi= set target ABI (for example: 'x86' or 'amd64')" echo " --os= set target OS (for example: 'windows' or 'linux')" + echo " --prefix= set install target prefix (default: /usr/local)" echo " --verbose be verbose" exit 0;; *) echo "warning: unknown option \"$1\"." 1>&2 @@ -470,6 +474,8 @@ echo "CD=cd" >> makefile.inc echo "RM=rm -f" >> makefile.inc echo "MKDIR=mkdir -p" >> makefile.inc +echo "PREFIX=$prefix" >> makefile.inc + # clean up and go to root dir again # rm -f tst$exe hasgot.c *$obj @@ -506,4 +512,4 @@ echo "> make tests" echo echo "Test release version:" echo "> make tests VARIANT=release" -echo \ No newline at end of file +echo