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

View File

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