projects/sencrypt

annotate Makefile @ 0:73af139d1a94

Initial revision
author Guido Berhoerster <guido+sencrypt@berhoerster.name>
date Tue Jan 28 19:23:16 2014 +0100 (2014-01-28)
parents
children f0ceb0ad20e7
rev   line source
guido+sencrypt@0 1 #
guido+sencrypt@0 2 # Copyright (C) 2014 Guido Berhoerster <guido+sencrypt@berhoerster.name>
guido+sencrypt@0 3 #
guido+sencrypt@0 4 # Permission is hereby granted, free of charge, to any person obtaining
guido+sencrypt@0 5 # a copy of this software and associated documentation files (the
guido+sencrypt@0 6 # "Software"), to deal in the Software without restriction, including
guido+sencrypt@0 7 # without limitation the rights to use, copy, modify, merge, publish,
guido+sencrypt@0 8 # distribute, sublicense, and/or sell copies of the Software, and to
guido+sencrypt@0 9 # permit persons to whom the Software is furnished to do so, subject to
guido+sencrypt@0 10 # the following conditions:
guido+sencrypt@0 11 #
guido+sencrypt@0 12 # The above copyright notice and this permission notice shall be included
guido+sencrypt@0 13 # in all copies or substantial portions of the Software.
guido+sencrypt@0 14 #
guido+sencrypt@0 15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
guido+sencrypt@0 16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
guido+sencrypt@0 17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
guido+sencrypt@0 18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
guido+sencrypt@0 19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
guido+sencrypt@0 20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
guido+sencrypt@0 21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
guido+sencrypt@0 22 #
guido+sencrypt@0 23
guido+sencrypt@0 24 PACKAGE = sencrypt
guido+sencrypt@0 25 VERSION = 1
guido+sencrypt@0 26 DISTNAME := $(PACKAGE)-$(VERSION)
guido+sencrypt@0 27 DECRYPT_ALIAS = sdecrypt
guido+sencrypt@0 28
guido+sencrypt@0 29 COMPILE.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(TARGET_ARCH) -c
guido+sencrypt@0 30 # gcc, clang, icc
guido+sencrypt@0 31 MAKEDEPEND.c = $(CC) -MM $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
guido+sencrypt@0 32 # Sun/Solaris Studio
guido+sencrypt@0 33 #MAKEDEPEND.c = $(CC) -xM1 $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
guido+sencrypt@0 34 # X makedepend
guido+sencrypt@0 35 #MAKEDEPEND.c = makedepend -f- -Y -- $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) --
guido+sencrypt@0 36 LINK.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(LDFLAGS) $(XLDFLAGS) $(TARGET_ARCH)
guido+sencrypt@0 37 LINK.o = $(CC) $(LDFLAGS) $(XLDFLAGS) $(TARGET_ARCH)
guido+sencrypt@0 38 INSTALL := install
guido+sencrypt@0 39 INSTALL.exec := $(INSTALL) -D -m 0755
guido+sencrypt@0 40 INSTALL.data := $(INSTALL) -D -m 0644
guido+sencrypt@0 41 PAX := pax
guido+sencrypt@0 42 GZIP := gzip
guido+sencrypt@0 43 SED := sed
guido+sencrypt@0 44
guido+sencrypt@0 45 DESTDIR ?=
guido+sencrypt@0 46 prefix ?= /usr/local
guido+sencrypt@0 47 bindir ?= $(prefix)/bin
guido+sencrypt@0 48 datadir ?= $(prefix)/share
guido+sencrypt@0 49
guido+sencrypt@0 50 HAVE_ERR_H ?= 1
guido+sencrypt@0 51
guido+sencrypt@0 52 OBJS = sencrypt.o
guido+sencrypt@0 53
guido+sencrypt@0 54 ifeq ($(HAVE_ERR_H),0)
guido+sencrypt@0 55 OBJS += err.o
guido+sencrypt@0 56 endif
guido+sencrypt@0 57
guido+sencrypt@0 58 .DEFAULT_TARGET = all
guido+sencrypt@0 59
guido+sencrypt@0 60 .PHONY: all clean clobber dist install
guido+sencrypt@0 61
guido+sencrypt@0 62 all: $(PACKAGE)
guido+sencrypt@0 63
guido+sencrypt@0 64 $(PACKAGE): XCPPFLAGS := -DOPENSSL_LOAD_CONF
guido+sencrypt@0 65 ifeq ($(HAVE_ERR_H),1)
guido+sencrypt@0 66 $(PACKAGE): XCPPFLAGS += -DHAVE_ERR_H
guido+sencrypt@0 67 endif
guido+sencrypt@0 68 $(PACKAGE): XCFLAGS := $(shell getconf LFS_CFLAGS)
guido+sencrypt@0 69 $(PACKAGE): LDLIBS := -lcrypto
guido+sencrypt@0 70 $(PACKAGE): XLDFLAGS := $(shell getconf LFS_LDFLAGS)
guido+sencrypt@0 71 $(PACKAGE): $(OBJS)
guido+sencrypt@0 72 $(LINK.o) $^ $(LDLIBS) -o $@
guido+sencrypt@0 73
guido+sencrypt@0 74 %.o: %.c
guido+sencrypt@0 75 $(MAKEDEPEND.c) $< | $(SED) -f deps.sed >$*.d
guido+sencrypt@0 76 $(COMPILE.c) -o $@ $<
guido+sencrypt@0 77
guido+sencrypt@0 78 install:
guido+sencrypt@0 79 $(INSTALL.exec) $(PACKAGE) "$(DESTDIR)$(bindir)/$(PACKAGE)"
guido+sencrypt@0 80 ln -f $(PACKAGE) "$(DESTDIR)$(bindir)/$(DECRYPT_ALIAS)"
guido+sencrypt@0 81
guido+sencrypt@0 82 clean:
guido+sencrypt@0 83 rm -f $(PACKAGE) $(OBJS)
guido+sencrypt@0 84
guido+sencrypt@0 85 clobber: clean
guido+sencrypt@0 86 rm -f $(patsubst %.o,%.d,$(OBJS))
guido+sencrypt@0 87
guido+sencrypt@0 88 dist: clobber
guido+sencrypt@0 89 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \
guido+sencrypt@0 90 -s ',\./,$(DISTNAME)/,' . | $(GZIP) > $(DISTNAME).tar.gz
guido+sencrypt@0 91
guido+sencrypt@0 92 -include $(patsubst %.o,%.d,$(OBJS))