netd: add hostname command

This commit is contained in:
Matheus
2026-04-15 16:48:25 -03:00
parent 338b448381
commit 6ba082f510
2 changed files with 38 additions and 1 deletions
+9 -1
View File
@@ -1,14 +1,22 @@
.phony: all install
CC=x86_64-astral-gcc
LD=x86_64-astral-gcc
all: netd
all: netd hostname
install:
mkdir -p "$(DESTDIR)/$(PREFIX)/sbin/"
mkdir -p "$(DESTDIR)/$(PREFIX)/bin/"
cp netd "$(DESTDIR)/$(PREFIX)/sbin/netd"
cp hostname "$(DESTDIR)/$(PREFIX)/bin/hostname"
netd: main.o
$(LD) $(LDFLAGS) -g -o $@ $^
hostname: hostname.o
$(LD) $(LDFLAGS) -g -o $@ $^
main.o: main.c
$(CC) -c $(CFLAGS) -g -o $@ $<
hostname.o: hostname.c
$(CC) -c $(CFLAGS) -g -o $@ $<