mirror of
https://github.com/riwiwa/muzi.git
synced 2025-12-30 12:45:26 -08:00
Added Makefile
This commit is contained in:
25
Makefile
Executable file
25
Makefile
Executable 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)
|
||||
Reference in New Issue
Block a user