23 lines
498 B
Makefile
23 lines
498 B
Makefile
|
CC=gcc
|
||
|
CFLAGS=-Wall -g -DDEBUG
|
||
|
LDFLAGS=#-lpthread
|
||
|
SRCDIR=src
|
||
|
OBJDIR=obj
|
||
|
BINDIR=bin
|
||
|
SRC=$(notdir $(wildcard $(SRCDIR)/*.c))
|
||
|
OBJ=$(SRC:.c=.o)
|
||
|
BIN=pixled
|
||
|
|
||
|
all: $(addprefix $(BINDIR)/, $(BIN))
|
||
|
|
||
|
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
||
|
if [ ! -d $(OBJDIR) ]; then mkdir "$(OBJDIR)"; fi
|
||
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||
|
|
||
|
$(BINDIR)/$(BIN) : $(addprefix $(OBJDIR)/, $(OBJ))
|
||
|
if [ ! -d "$(BINDIR)" ]; then mkdir "$(BINDIR)"; fi
|
||
|
$(CC) -o $@ $^ $(LDFLAGS)
|
||
|
|
||
|
clean:
|
||
|
rm -rf $(BINDIR)/* $(OBJDIR)/*
|
||
|
rmdir $(BINDIR) $(OBJDIR)
|