new build system

This commit is contained in:
Your Name 2023-11-04 22:06:27 +03:00
parent be9e6d3213
commit e82070ed99
11 changed files with 32 additions and 79 deletions

View File

@ -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/*

View File

@ -1,2 +1,10 @@
# micro-utils # micro-utils
[Compile]
cc builder.c -obuilder
./buulder
[or]
sh build.sh
[Config]
edit config.h

3
build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cc builder.c -Wall -Wextra -Os -s -pedantic -obuilder
./builder && rm builder

7
builder.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
#include <dirent.h>
#include "config.h"
int main(void) {
return 0;
}

14
config.h Normal file
View File

@ -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

View File

@ -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 $@ $<

View File

@ -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 $@ $<

View File

@ -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 $@ $<

View File

@ -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 $@ $<

View File

@ -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 $@ $<

View File

@ -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 $@ $<