Added Makefile

This commit is contained in:
2025-11-12 01:29:10 -08:00
parent d784a53e77
commit 8790faaebc
2 changed files with 26 additions and 3 deletions

25
Makefile Executable file
View File

@@ -0,0 +1,25 @@
CC=gcc
CFLAGS=-Wall -Wextra -Wpedantic -std=c11 -fdiagnostics-color=always -D_DEFAULT_SOURCE -g -I./include
LIBS=-Wl,--no-as-needed -lcjson -lzip
TARGET=muzi
SOURCES = muzi.c
OBJECTS = $(SOURCES:.c=.o)
OUTDIR=./build
OBJDIR=$(OUTDIR)/obj
$(shell mkdir -p $(OBJDIR))
%.o: %.c
$(CC) -c -o $(OBJDIR)/$@ $< $(CFLAGS)
$(TARGET): $(OBJECTS)
$(CC) -o $(OUTDIR)/$@ $(OBJDIR)/$(OBJECTS) $(CFLAGS) $(LIBS)
.PHONY: all
all: $(TARGET)
.DEFAULT_GOAL := all
clean:
rm -rf $(OUTDIR)

4
muzi.c
View File

@@ -27,9 +27,7 @@ int get_artist_plays(void);
int import_spotify(void);
int get_artist_plays(void) {
FILE *fp = fopen("/home/r/dl/spotify-data/rm35@gm - Spotify Extended "
"Streaming History/Streaming_History_Audio_2020-2021_4.json",
"r");
FILE *fp = fopen("test.json", "r");
if (fp == NULL) {
printf("Error while opening file\n");
return 1;