diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-08-26 21:03:06 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-08-26 21:06:30 +0200 |
commit | 7731613f50eb45e5af9cd96e05fc7e43dc3643d1 (patch) | |
tree | 53661e63c18307c262855b4aabb0b221fc6934ee | |
parent | 3c6e5ff32fd24acf5e1deb62860ddd7b864066b3 (diff) |
Remove Makefile and add minimalistic README.
-rw-r--r-- | Makefile | 35 | ||||
-rw-r--r-- | README.md | 58 |
2 files changed, 58 insertions, 35 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index 6358394..0000000 --- a/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -all: libcppbuild.a cppbuild - -SRC = \ - libcppbuild.cc \ - task_cc.cc \ - task_ld.cc \ - task_ar.cc \ - task_so.cc \ - task.cc \ - execute.cc \ - configure.cc \ - rebuild.cc \ - tasks.cc \ - build.cc \ - -OBJ = $(patsubst %.cc,%.o,$(SRC)) - -DEPFILES := $(patsubst %.cc,%.d,$(SRC)) -$(DEPFILES): - -include $(wildcard $(DEPFILES)) - -CXXFLAGS = -Wall -g -O3 -std=c++17 -I. - -%.o: %.cc - g++ -MMD $(CXXFLAGS) -c $< -o $@ - -libcppbuild.a: $(OBJ) - ar rcs $@ $(OBJ) - -cppbuild: libcppbuild.a - g++ $(CXXFLAGS) -pthread libcppbuild.a -o $@ - -clean: - rm -f libcppbuild.a $(OBJ) cppbuild $(DEPFILES) diff --git a/README.md b/README.md new file mode 100644 index 0000000..fea7c11 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# Introduction + +Have you ever wondered, if you want to compile a C++ program, why you always +need to learn another language to make it build properly with dependency +tracking and so on. + +Many good build-systems exists which all have their strengths and weeknesses +autotools, cmake, meson to name a few. + +`cppbuild` tries to make it possible to use all the cool features of the above +in a tool only using C++ (through the compiler). + +## Getting Started: 3 Simple Steps + +Step 1: Create a build configuration, in C++ + +A really simple example ('hello_config.cc'): +```c++ +#include "libcppbuild.h" + +namespace +{ +BuildConfigurations helloConfigs() +{ + return + { + { + .target = "hello", + .sources = { + "hello.cc", + }, + .cxxflags = { + "-Wall", + "-std=c++17", + } + }, + }; +} + +REG(helloConfigs); +} +``` + +Step 2: Bootstrap the system by compiling your build configuration along with +the libcppbuild.a static library: +```sh +g++ -std=c++17 hello_config.cc -pthread libcppbuild.a -o cppbuild +``` + +Step 3: Run cppbuild to build you application: + +```sh +./cppbuild +``` + +Any consecutive changes to the build configuration or any of the sources will +automagically trigger a rebuild of all (and only) affected sources the next time +cppbuild is executed. |