added cmake meson update makefile and update actions
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 5s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 11s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 9s

This commit is contained in:
wt
2026-02-07 19:38:52 +07:00
parent bce5ba8ef5
commit a820f1f032
6 changed files with 82 additions and 32 deletions
+15 -23
View File
@@ -1,28 +1,20 @@
CC=gcc
CFLAGS=-Wall
SOURCES=src/sudo.c
TARGET=bin/sudo
CC = gcc
CFLAGS = -Wall -g -std=gnu2x
LDFLAGS =
LIBS =
INCLUDES = -I./src/lib -I./src
SRCS = $(wildcard src/*.c src/lib/*.c)
OBJS = $(SRCS:.c=.o)
TARGET = sudo
CROSS_COMPILE =
default: all
all: $(TARGET)
all: build
$(TARGET): $(OBJS)
$(CROSS_COMPILE)$(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
build:
@if [ ! -d bin ]; then \
mkdir bin; \
fi
$(CC) -o $(TARGET) $(SOURCES) $(CFLAGS)
chown -v 0:0 $(TARGET)
chmod 4755 $(TARGET)
%.o: %.c
$(CROSS_COMPILE)$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
rm -v $(TARGET)
package:
mkdir -pv sudo.pkg/usr/bin
cp -v $(TARGET) sudo.pkg/usr/bin/sudo
echo "/usr/bin/sudo" > sudo.pkg/list
printf "#!/bin/sh\nchown -v 0:0 /usr/bin/sudo\nchmod 4755 /usr/bin/sudo" > sudo.pkg/post_install
chmod +x sudo.pkg/post_install
tar -czvf sudo.pkg.gz sudo.pkg
rm -f $(OBJS) $(TARGET) $(shell find . -type f -name '*.log') users.db