Commit 8356b2b726

8356b2b726cb626511a8dd32b9ccf22b7cf7a34d

Unsigned

Ilkay Alakay <ilkay@exherbo.domain.foo> · 2026-10-02 13:47 UTC

ilkay/imake: initial commit

Layout: unified · split

README.md added +8
@@ -0,0 +1,8 @@
1# imake
2
3a compiling frontend. alternative for GNU make.
4
5# installing (as root)
6```chmod +x imake && mv imake /usr/local/bin```
7
8*make sure you have your compiler (i.e. gcc) linked as cc (in /usr/bin).*
imake added +32
@@ -0,0 +1,32 @@
1#!/bin/bash
2# Ilkay Alakay <ilkay@astronix.org>. Licensed under The Unlicense
3
4DIR="$(pwd)"
5IMAKEFILE="$DIR/IMakefile"
6
7if [[ ! -f "$IMAKEFILE" ]]; then
8 echo "imake: IMakefile not found in $DIR" >&2
9 exit 1
10fi
11
12while IFS= read -r line || [[ -n "$line" ]]; do
13 [[ -z "$line" ]] && continue
14
15 printf '%s:\n' "$line"
16
17 output=$(bash -c "$line" 2>&1)
18 status=$?
19
20 if [[ -n "$output" ]]; then
21 while IFS= read -r output_line || [[ -n "$output_line" ]]; do
22 printf ' %s\n' "$output_line"
23 done <<< "$output"
24 else
25 printf ' \n'
26 fi
27
28 if [[ $status -ne 0 ]]; then
29 printf ' Command failed with exit code %d\n' "$status"
30 exit "$status"
31 fi
32done < "$IMAKEFILE"