creates a whole suite

This commit is contained in:
SuperNovaa41 2025-02-24 11:21:01 -05:00
parent bbffefd301
commit 5ae738b0cf
3 changed files with 55 additions and 2 deletions

9
install.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
mkdir -p $HOME/.config/templates/
cp -r templates/* $HOME/.config/templates
chmod +x run.sh
sudo cp run.sh /usr/local/bin/tempc

24
run.sh
View File

@ -1,9 +1,29 @@
#!/bin/bash #!/bin/bash
git init list_templates() {
for dir in $HOME/.config/templates/*/
do
dir=${dir%*/}
echo "${dir##*/}"
done
}
if [[ -z "$1" ]]; then
echo "No template provided."
echo "Available templates:"
list_templates
exit
fi
if [ ! -d "$HOME/.config/templates/$1" ]; then if [ ! -d "$HOME/.config/templates/$1" ]; then
echo "Template doesn't exist!" echo "Template doesn't exist!"
echo "Available templates:"
list_templates
exit
else else
cp -r ~/.config/templates/$1/* . cp -r $HOME/.config/templates/$1/* .
git init
fi fi

24
templates/c/Makefile Normal file
View File

@ -0,0 +1,24 @@
CC=gcc
CFLAGS= -c -g -Wall
#LDLIBS = # -lcurl -lssl ...
#TARGET :=
BUILD_DIR := ./build
SRC_DIRS := ./src
SRCS := $(shell find $(SRC_DIRS) -name '*.c')
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
$(BUILD_DIR)/$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDLIBS)
$(BUILD_DIR)/%.c.o: %.c
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)