diff --git a/Makefile b/Makefile deleted file mode 100644 index 4076df1..0000000 --- a/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -objects = coreutils console-tools networking procps shell - -CFLAGS?=-s -Os -flto -pedantic -Wall -Wextra -CC?=cc - -all: $(objects) - -$(objects): - echo MAKE $@ - cd $@ && $(MAKE) -B CC="$(CC)" CFLAGS="$(CFLAGS) -I../libmu" && cd .. - -clean: - rm bin/* diff --git a/README.md b/README.md index 2e92f4f..f8ae339 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # micro-utils +[Compile] + cc builder.c -obuilder + ./buulder + [or] + sh build.sh + +[Config] + edit config.h diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..b214bcf --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cc builder.c -Wall -Wextra -Os -s -pedantic -obuilder +./builder && rm builder diff --git a/builder.c b/builder.c new file mode 100644 index 0000000..ceb0dba --- /dev/null +++ b/builder.c @@ -0,0 +1,7 @@ +#include +#include +#include "config.h" + +int main(void) { + return 0; +} diff --git a/config.h b/config.h new file mode 100644 index 0000000..d863928 --- /dev/null +++ b/config.h @@ -0,0 +1,14 @@ +#ifndef _CONFIG_H +#define _CONFIG_H + +const char *objects[] = { + "console-tools", + "coreutils", + "networking", + "procps", + "shell" +}; + +#define CFLAGS "-Wall -Wextra -pedantic -Os -s" +#define CC "cc" +#endif diff --git a/console-tools/Makefile b/console-tools/Makefile deleted file mode 100644 index 76c8c29..0000000 --- a/console-tools/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -C_SOURCES:=$(wildcard ./*.c) -C_TARGETS:=$(patsubst ./%.c, ../bin/%, $(C_SOURCES)) -TARGETS:=$(C_TARGETS) - -CFLAGS?=-s -Os -flto -pedantic -Wall -Wextra -CC?=cc - -all: ../bin $(TARGETS) - -../bin/%: %.c - $(CC) $(CFLAGS) -o $@ $< diff --git a/coreutils/Makefile b/coreutils/Makefile deleted file mode 100644 index 76c8c29..0000000 --- a/coreutils/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -C_SOURCES:=$(wildcard ./*.c) -C_TARGETS:=$(patsubst ./%.c, ../bin/%, $(C_SOURCES)) -TARGETS:=$(C_TARGETS) - -CFLAGS?=-s -Os -flto -pedantic -Wall -Wextra -CC?=cc - -all: ../bin $(TARGETS) - -../bin/%: %.c - $(CC) $(CFLAGS) -o $@ $< diff --git a/miscutils/Makefile b/miscutils/Makefile deleted file mode 100644 index 76c8c29..0000000 --- a/miscutils/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -C_SOURCES:=$(wildcard ./*.c) -C_TARGETS:=$(patsubst ./%.c, ../bin/%, $(C_SOURCES)) -TARGETS:=$(C_TARGETS) - -CFLAGS?=-s -Os -flto -pedantic -Wall -Wextra -CC?=cc - -all: ../bin $(TARGETS) - -../bin/%: %.c - $(CC) $(CFLAGS) -o $@ $< diff --git a/networking/Makefile b/networking/Makefile deleted file mode 100644 index 76c8c29..0000000 --- a/networking/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -C_SOURCES:=$(wildcard ./*.c) -C_TARGETS:=$(patsubst ./%.c, ../bin/%, $(C_SOURCES)) -TARGETS:=$(C_TARGETS) - -CFLAGS?=-s -Os -flto -pedantic -Wall -Wextra -CC?=cc - -all: ../bin $(TARGETS) - -../bin/%: %.c - $(CC) $(CFLAGS) -o $@ $< diff --git a/procps/Makefile b/procps/Makefile deleted file mode 100644 index 76c8c29..0000000 --- a/procps/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -C_SOURCES:=$(wildcard ./*.c) -C_TARGETS:=$(patsubst ./%.c, ../bin/%, $(C_SOURCES)) -TARGETS:=$(C_TARGETS) - -CFLAGS?=-s -Os -flto -pedantic -Wall -Wextra -CC?=cc - -all: ../bin $(TARGETS) - -../bin/%: %.c - $(CC) $(CFLAGS) -o $@ $< diff --git a/shell/Makefile b/shell/Makefile deleted file mode 100644 index 76c8c29..0000000 --- a/shell/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -C_SOURCES:=$(wildcard ./*.c) -C_TARGETS:=$(patsubst ./%.c, ../bin/%, $(C_SOURCES)) -TARGETS:=$(C_TARGETS) - -CFLAGS?=-s -Os -flto -pedantic -Wall -Wextra -CC?=cc - -all: ../bin $(TARGETS) - -../bin/%: %.c - $(CC) $(CFLAGS) -o $@ $<