Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
archived/Makefile
2010-10-22 13:59:08 +02:00

52 lines
1.2 KiB
Makefile

#
# Archive Makefile
#
# uncomment and edit this to match your system
#DB_HOST := localhost
#DB_USER := dbusr
#DB_PASS := dbpass
#DB_NAME := dbname
#DB_TBL := dbtable
CC := gcc
CFLAGS := -Werror `mysql_config --cflags`
LDFLAGS := -L/usr/lib/mysql -lmysqlclient
ifdef DEBUG
CFLAGS += -g -D__DEBUG__
endif
SOURCES := \
src/arch.c \
src/arch/mysql.c \
src/indexer.c \
src/common/path.c \
src/common/rbtree.c \
src/notify/inotify.c \
src/notify/event.c \
src/notify/tree.c
BUILD := ./build
all :
@mkdir -p $(BUILD)
ifdef DB_HOST
make wrapper
else
@echo "Tip: edit this Makefile DB_* macros to enable generation of a wrapper shellscript"
endif
$(CC) $(CFLAGS) $(LDFLAGS) $(SOURCES) -o $(BUILD)/arch
wrapper :
@echo "#!/bin/sh" > $(BUILD)/wrapper
@echo "if [ \$$# -lt 1 ]; then" >> $(BUILD)/wrapper
@echo " echo \"usage: \$$0 <rootdir>\"" >> $(BUILD)/wrapper
@echo " exit" >> $(BUILD)/wrapper
@echo "fi" >> $(BUILD)/wrapper
@echo "./arch \"\$$1\" \"$(DB_HOST)\" \"$(DB_USER)\" \"$(DB_PASS)\" \"$(DB_NAME)\" \"$(DB_TBL)\"" >> $(BUILD)/wrapper
@chmod 755 $(BUILD)/wrapper
@echo "generated $(BUILD)/wrapper"
clean :
rm -fr $(BUILD)