# Makefile # (C) 2006 Philip Endecott # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. default_target: compile LIBPBE_DIR=../libpbe CPP_FLAGS=-I$(LIBPBE_DIR)/include #GCC_FLAGS=-pthread GCC_FLAGS=-D_REENTRANT COMPILE_FLAGS=$(CPP_FLAGS) $(GCC_FLAGS) -Wall -O C_COMPILE_FLAGS=$(COMPILE_FLAGS) -std=gnu99 CC_COMPILE_FLAGS=$(COMPILE_FLAGS) LINK_FLAGS=-L$(LIBPBE_DIR)/build_arm -lpbe \ -lboost_thread \ -lboost_program_options C_SRCS=$(wildcard *.c) CC_SRCS=$(wildcard *.cc) OBJS=$(addsuffix .o,$(basename $(C_SRCS) $(CC_SRCS))) %.o: %.cc $(CXX) $(CC_COMPILE_FLAGS) -o $@ -c $< %.o: %.c $(CC) $(C_COMPILE_FLAGS) -o $@ -c $< compile: $(OBJS) $(LIBPBE_DIR)/libpbe.a $(CXX) -o mpegdaemon $(OBJS) $(LINK_FLAGS) %.d: %.cc $(CXX) -MM -MG -MT $@ -MT $(<:%.cc=%.o) $(CPP_FLAGS) $(GCC_FLAGS) -o $@ $< %.d: %.c $(CC) -MM -MG -MT $@ -MT $(<:%.c=%.o) $(CPP_FLAGS) $(GCC_FLAGS) -o $@ $< DEPENDS=$(addsuffix .d,$(basename $(OBJS))) -include $(DEPENDS) $(LIBPBE_DIR)/libpbe.a: FORCE cd $(LIBPBE_DIR); make DISABLE_POSTGRESQL=1 DISABLE_IMAGEMAGICK=1 DISABLE_RECODE=1 libpbe.a install: # install -s mpegdaemon /usr/local/bin # We don't have strip on the slug cp mpegdaemon /usr/local/bin clean: FORCE $(RM) -f *.o veryclean: clean $(RM) *.d .PHONY: default_target compile install FORCE