insert_event #1

Merged
bjoernf merged 16 commits from insert_event into master 2023-09-09 08:26:50 +02:00
3 changed files with 14 additions and 52 deletions
Showing only changes of commit 24e05a990d - Show all commits

View File

@ -1,32 +0,0 @@
all:
gcc -Wall ./src/*.c
.PHONY: debug
debug:
gcc -Wall -g ./src/*.c
gdb a.out
.PHONY: run
run:
gcc -Wall ./src/*.c
./a.out
.PHONY: install
install: a.out
cp a.out /usr/local/bin/ics_analyzer
.PHONY: clean
clean:
rm a.out
.PHONY: uninstall
uninstall:
rm /usr/local/bin/ics_analyzer
.PHONY: test
test:
./a.out
@echo
./a.out -h
@echo
./a.out -f tests/calendar.ics

View File

@ -8,9 +8,11 @@ SRC_FILES = $(wildcard *.c)
# Generate a list of object files by replacing the .c extension with .o
OBJ_FILES = $(SRC_FILES:.c=.o)
EXECUTABLE = "icscli"
# linking
ics_analyzer: $(OBJ_FILES)
gcc -Wall $(OBJ_FILES) -o ics_analyzer $(LDFLAGS)
$(EXECUTABLE): $(OBJ_FILES)
gcc -Wall $(OBJ_FILES) -o $(EXECUTABLE) $(LDFLAGS)
main.o: main.c
$(CC) $(CFLAGS) -c $<
@ -19,31 +21,22 @@ main.o: main.c
%.o: %.c %.h
$(CC) $(CFLAGS) -c $<
.PHONY:all
all:
gcc -Wall *.c
.PHONY:run
run:
gcc -Wall *.c
./ics_analyzer
.PHONY:install
install: a.out
cp ics_analyzer /usr/local/bin/ics_analyzer
install: $(EXECUTABLE)
cp $(EXECUTABLE) /usr/local/bin/$(EXECUTABLE)
.PHONY:clean
clean:
-rm ics_analyzer *.o
-rm $(EXECUTABLE) *.o
.PHONY:uninstall
uninstall:
-rm /usr/local/bin/ics_analyzer
-rm /usr/local/bin/$(EXECUTABLE)
.PHONY:test
test:
./ics_analyzer
./$(EXECUTABLE)
@echo
./ics_analyzer -h
./$(EXECUTABLE) -h
@echo
./ics_analyzer -f ../tests/calendar.ics
./$(EXECUTABLE) -f ../tests/calendar.ics

View File

@ -6,8 +6,9 @@
#include <string.h>
void usage() {
printf ("-h\tprint this help\n");
printf ("-f\tspecify ics file path\n");
printf ("-f [FILE PATH]\t\tspecify ics file path\n");
printf ("-h\t\t\tprint this help\n");
printf ("-i\t\t\tinsert an event\n");
exit(0);
}