fileshare/Makefile

34 lines
639 B
Makefile

MAGIC_CFLAGS=-DHAVE_MAGIC
MAGIC_LIBS=-lmagic
CC=gcc
CFLAGS+=-Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=20120607L -D_FILE_OFFSET_BITS=64 $(MAGIC_CFLAGS)
LIBS=-lmicrohttpd $(MAGIC_LIBS)
TARGET=fileshare
SOURCE=main.c logger.c dirlisting.c util.c
DEPS=logger.h templates.h dirlisting.h util.h
OBJ=$(patsubst %.c, %.o, $(SOURCE))
all: debug
debug: CFLAGS+=-O0 -ggdb -DDEBUG
debug: $(TARGET)
release: CFLAGS+=-O3
release: $(TARGET)
$(TARGET): $(OBJ) $(DEPS) Makefile
$(CC) -o $(TARGET) $(OBJ) $(LIBS)
%.o: %.c $(DEPS) Makefile
$(CC) -c $(CFLAGS) -o $@ $< $(INCLUDES)
doc:
doxygen doxygen.conf
clean:
rm -f $(TARGET)
rm -f $(OBJ)