$OpenBSD: patch-makefile,v 1.3 2009/06/03 16:32:54 ajacoutot Exp $ --- makefile.orig Sun Mar 5 14:39:37 2006 +++ makefile Tue Jun 2 16:20:23 2009 @@ -2,34 +2,34 @@ HOWL_ENABLE = 1 ZLIB_ENABLE = 1 -MPEG4_ENABLE = 0 +MPEG4_ENABLE = 1 # no need to touch anything below this line # ----------------------------------------- -CC = g++ +CC?= g++ MAKE = $(MAKE_COMMAND) TARGET = daapd DEPS = daaplib_ libhttpd_ OBJS = daapd.o db.o dboutput.o songcache.o parsemp3.o util.o LIBS = -ldaaplib -lhttpd-persistent -lid3tag -lz -LIBPATH = -L. -L./daaplib/src -L./libhttpd/src -L/usr/local/lib -INCPATH = -I. -I./daaplib/include -I./libhttpd/src -I/usr/local/include +LIBPATH = -L. -L./daaplib/src -L./libhttpd/src -L$(LOCALBASE)/lib +INCPATH = -I. -I./daaplib/include -I./libhttpd/src -I$(LOCALBASE)/include DEPLOY = /usr/local -CFLAGS = -Wall -Wno-multichar +CFLAGS+= -Wall -Wno-multichar # HOWL ifeq ($(HOWL_ENABLE),1) - HOWLDIRS := $(sort $(wildcard /usr/local/include/howl*) ) + HOWLDIRS := $(sort $(wildcard $(LOCALBASE)/include/avahi-compat-howl*) ) ifeq ($(words $(HOWLDIRS) ), 0) -$(error howl not found in /usr/local/include. Install howl or disable it in the makefile) +$(error howl not found in $(LOCALBASE)/include. Install howl or disable it in the makefile) endif HOWLRECENT := $(word $(words $(HOWLDIRS)),$(HOWLDIRS) ) INCPATH := $(INCPATH) -I$(HOWLRECENT) LIBS := $(LIBS) -lhowl CFLAGS := $(CFLAGS) -DHOWL_ENABLE - ifneq ($(shell $(CC) -E -dM - < /dev/null | grep __APPLE__),) + ifneq ($(shell $(CXX) -E -dM - < /dev/null | grep __APPLE__),) LIBS := $(LIBS) -framework CoreFoundation endif endif @@ -42,28 +42,28 @@ ifeq ($(MPEG4_ENABLE),1) endif # platform specific stuff -ifneq ($(shell $(CC) -E -dM - < /dev/null | grep __sun__),) +ifneq ($(shell $(CXX) -E -dM - < /dev/null | grep __sun__),) LIBS := $(LIBS) -lsocket -lnsl endif -ifneq ($(shell $(CC) -E -dM - < /dev/null | grep __FreeBSD__),) +ifneq ($(shell $(CXX) -E -dM - < /dev/null | egrep '__FreeBSD__|__OpenBSD__'),) LIBS := $(LIBS) -pthread else LIBS := $(LIBS) -lpthread endif -ifneq ($(shell $(CC) -E -dM - < /dev/null | grep __sgi__),) +ifneq ($(shell $(CXX) -E -dM - < /dev/null | grep __sgi__),) LIBS := $(LIBS) /usr/lib/snprintf.o endif .cc.o: - $(CC) $(CFLAGS) $(INCPATH) -c $< + $(CXX) $(CFLAGS) $(INCPATH) -c $< all: $(DEPS) $(TARGET) $(TARGET): $(OBJS) - $(CC) $(CFLAGS) $(LIBPATH) -o $(TARGET) $(OBJS) $(LIBS) + $(CXX) $(CFLAGS) $(LIBPATH) -o $(TARGET) $(OBJS) $(LIBS) $(OBJS): types.h dboutput.h songcache.h parsemp3.h @@ -80,8 +80,6 @@ clean: rm $(OBJS) $(TARGET) install: $(DEPS) $(TARGET) - cd libhttpd && $(MAKE) install - cd daaplib/src && $(MAKE) install cp $(TARGET) $(DEPLOY)/bin chmod a+rx $(DEPLOY)/bin/$(TARGET) cp $(TARGET).8 $(DEPLOY)/man/man8