diff --git a/README.md b/README.md index 79e3ed3..ece6858 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,13 @@ # cbuild My C/C++ build system written in bash. -Repo contains some scripts (functions, init, etc.), which can be used in your custom task scripts. There are also some default tasks. +Repo contains some functions, which can be used in your custom task scripts. There are also some default tasks. -All tasks should be launched through `Makefile`. Tasks can be configured in `current.config` file (it is automatically created by init.sh). +All tasks can be launched through `Makefile` or `cbuild/call_task.sh`. Tasks can be configured in `current.config`. ## How to set up - ```bash -cd some_project -git clone http://github.com/Timerix22/cbuild.git -cp cbuild/default.Makefile Makefile -bash cbuild/chmod_scripts.sh -make +git clone http://github.com/Timerix22/cbuild.git && \ +cbuild/setup.sh submodule ``` - -You should create your own default config. Put it in project directory and name default.config +Than create your project `default.config` based on `cbuild/default.config`. diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..22978de --- /dev/null +++ b/setup.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if [ $# -eq 0 ] || [ "$1" = "h" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "/?" ]; then + echo "usage: setup.sh [ submodule | standalone ]" + echo " submodule - add to existing git repo as submodule" + echo " standalone - keep independent git repo" +fi + +case $1 in + submodule) + echo "mode - $1" + git submodule add cbuild + ;; + standalone) + echo "mode - $1" + ;; + *) + echo "invalid argument: $1" + exit 1 + ;; +esac + +cp cbuild/default.Makefile Makefile +cp cbuild/default.config +bash cbuild/chmod_scripts.sh