-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsharedobjectbuildingmakefiles-installer.sh
67 lines (49 loc) · 3.72 KB
/
sharedobjectbuildingmakefiles-installer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
echo Installation started!
# TODO: Burası user config side
SHARED_OBJECT_BUILDING_MAKEFILES_BASE_DIR="$HOME/SharedObjectBuildingMakefiles"
# Most of the time you don't have to change this path.
# Ld config path is a standard location in Linux distributions.
# The following folder path is used on
# openSUSE 13.2 (Harlequin) (i586)
# and
# Ubuntu 18.04.3 LTS (Bionic Beaver)
# operating systems.
# Check this path for the linux distribution you are using.
LD_CONFIG_DIR=/etc/ld.so.conf.d
SOBM_LD_CONFIG_FILE=$LD_CONFIG_DIR/SharedObjectBuildingMakefiles.conf
CPP_LIBRARY_MAKEFILE_PATH="$SHARED_OBJECT_BUILDING_MAKEFILES_BASE_DIR/makefiles/01-cpp/01-library"
CPP_COMPILED_LIBRARIES_INC_DIR="$SHARED_OBJECT_BUILDING_MAKEFILES_BASE_DIR/CompiledLibraries/01-inc"
CPP_COMPILED_LIBRARIES_SO_DIR="$SHARED_OBJECT_BUILDING_MAKEFILES_BASE_DIR/CompiledLibraries/02-so"
CPP_PROJECT_MAKEFILE_PATH="$SHARED_OBJECT_BUILDING_MAKEFILES_BASE_DIR/makefiles/01-cpp/02-project"
CPP_LIBRARY_MAKEFILE_PATH_IN_REPO=makefiles/01-cpp/01-library/makefile
mkdir --verbose --parents $CPP_LIBRARY_MAKEFILE_PATH
cp --verbose $CPP_LIBRARY_MAKEFILE_PATH_IN_REPO $CPP_LIBRARY_MAKEFILE_PATH
mkdir --verbose --parents $CPP_COMPILED_LIBRARIES_INC_DIR
mkdir --verbose --parents $CPP_COMPILED_LIBRARIES_SO_DIR
CPP_PROJECT_MAKEFILE_PATH_IN_REPO=makefiles/01-cpp/02-project/makefile
mkdir --verbose --parents $CPP_PROJECT_MAKEFILE_PATH
cp --verbose $CPP_PROJECT_MAKEFILE_PATH_IN_REPO $CPP_PROJECT_MAKEFILE_PATH
BASHRC_FILE_PATH="$HOME/.bashrc"
echo -e "\n\n################################################################################" >> $BASHRC_FILE_PATH
echo "# MAKEFILE SPECIFIC CONFIGURATIONS START #" >> $BASHRC_FILE_PATH
echo "################################################################################" >> $BASHRC_FILE_PATH
echo "# NOTE: This part of the file is generated by the Shared Object Building " >> $BASHRC_FILE_PATH
echo "# Makefiles program at " $(date) >> $BASHRC_FILE_PATH
echo -e "\n" >> $BASHRC_FILE_PATH
echo "export SHARED_OBJECT_BUILDING_MAKEFILES_BASE_DIR=$SHARED_OBJECT_BUILDING_MAKEFILES_BASE_DIR" >> $BASHRC_FILE_PATH
echo "export SOBM_LD_CONFIG_FILE=$SOBM_LD_CONFIG_FILE" >> $BASHRC_FILE_PATH
echo "" >> $BASHRC_FILE_PATH
echo "export CPP_LIBRARY_MAKEFILE_PATH=$CPP_LIBRARY_MAKEFILE_PATH/makefile" >> $BASHRC_FILE_PATH
echo "export CPP_COMPILED_LIBRARIES_INC_DIR=$CPP_COMPILED_LIBRARIES_INC_DIR" >> $BASHRC_FILE_PATH
echo "export CPP_COMPILED_LIBRARIES_SO_DIR=$CPP_COMPILED_LIBRARIES_SO_DIR" >> $BASHRC_FILE_PATH
echo "" >> $BASHRC_FILE_PATH
echo "export CPP_PROJECT_MAKEFILE_PATH=$CPP_PROJECT_MAKEFILE_PATH/makefile" >> $BASHRC_FILE_PATH
echo -e "\n" >> $BASHRC_FILE_PATH
echo "################################################################################" >> $BASHRC_FILE_PATH
echo "# MAKEFILE SPECIFIC CONFIGURATIONS END #" >> $BASHRC_FILE_PATH
echo "################################################################################" >> $BASHRC_FILE_PATH
echo "# NOTE: Generated by the Shared Object Building Makefiles program at" $(date) | sudo tee $SOBM_LD_CONFIG_FILE
echo $CPP_COMPILED_LIBRARIES_SO_DIR | sudo tee --append $SOBM_LD_CONFIG_FILE
sudo ldconfig
echo Installation was successful!
xdg-open "https://github.com/ondergormez/SharedObjectBuildingMakefiles/blob/master/Release Notes/"