creates a whole suite
This commit is contained in:
parent
bbffefd301
commit
5ae738b0cf
9
install.sh
Executable file
9
install.sh
Executable 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
24
run.sh
@ -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
24
templates/c/Makefile
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user