Check-in [08602df0fc]
Overview
Comment:Updated to support compiling filed in alternate directories
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:08602df0fccba1ad0617a80cb5cc59272f9db44d
User & Date: rkeene on 2016-09-22 19:02:20
Other Links: manifest | tags
Context
2016-09-22
19:28
Added script to create precompiled binaries check-in: d3f770e3c3 user: rkeene tags: trunk
19:02
Updated to support compiling filed in alternate directories check-in: 08602df0fc user: rkeene tags: trunk
18:34
Updated to use nanosleep() instead of usleep() which requires a _BSD_SOURCE macro check-in: 1fb0b13c23 user: rkeene tags: trunk
Changes

Modified Makefile from [d6a72f7309] to [2fd19df44e].

     1      1   CC = gcc
     2         -CFLAGS = -std=gnu11 -Wall -W -pthread -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE $(FILED_EXTRA_CFLAGS)
            2  +CFLAGS = -I. -std=gnu11 -Wall -W -pthread -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE $(FILED_EXTRA_CFLAGS)
     3      3   LDFLAGS = -pthread $(FILED_EXTRA_LDFLAGS)
     4      4   LIBS = -lpthread $(FILED_EXTRA_LIBS)
     5      5   MIMETYPES = /etc/httpd/mime.types
     6      6   
     7      7   PREFIX = /usr/local
     8      8   prefix = $(PREFIX)
     9      9   bindir = $(prefix)/bin
    10     10   mandir = $(prefix)/share/man
           11  +srcdir = .
           12  +vpath %.c $(srcdir)
    11     13   
    12     14   all: filed
    13     15   
    14     16   filed: filed.o
    15     17   	$(CC) $(CFLAGS) $(LDFLAGS) -o "$@" $^ $(LIBS)
    16     18   
    17         -filed.o: filed.c filed-mime-types.h
           19  +filed.o: $(srcdir)/filed.c filed-mime-types.h
    18     20   
    19         -filed-mime-types.h: generate-mime-types mime.types
    20         -	./generate-mime-types "$(MIMETYPES)" > filed-mime-types.h.new || \
    21         -		./generate-mime-types mime.types > filed-mime-types.h.new
           21  +filed-mime-types.h: $(srcdir)/generate-mime-types $(srcdir)/mime.types
           22  +	'$(srcdir)/generate-mime-types' '$(MIMETYPES)' > filed-mime-types.h.new || \
           23  +		'$(srcdir)/generate-mime-types' '$(srcdir)/mime.types' > filed-mime-types.h.new
    22     24   	mv filed-mime-types.h.new filed-mime-types.h
    23     25   
    24         -install: filed filed.1
           26  +install: filed $(srcdir)/filed.1
    25     27   	test -d "$(DESTDIR)$(mandir)/man1" || mkdir -p "$(DESTDIR)$(mandir)/man1"
    26     28   	test -d "$(DESTDIR)$(bindir)" || mkdir -p "$(DESTDIR)$(bindir)"
    27         -	cp filed.1 "$(DESTDIR)$(mandir)/man1/"
           29  +	cp '$(srcdir)/filed.1' "$(DESTDIR)$(mandir)/man1/"
    28     30   	cp filed "$(DESTDIR)$(bindir)/"
    29     31   
    30     32   clean:
    31     33   	rm -f filed filed.o
    32     34   	rm -f filed-mime-types.h.new
    33     35   
    34     36   distclean: clean
    35     37   	rm -f filed-mime-types.h
    36     38   
    37     39   .PHONY: all install clean distclean