secnote

The secnote tool.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/secnote

Makefile (823B)



      1 # secnote Makefile
      2 
      3 BIN=secnote
      4 CC?=cc
      5 PREFIX?=/usr/local
      6 INSTALL_DIR=$(PREFIX)/bin
      7 MAN_DIR?=$(PREFIX)/share/man
      8 
      9 SRC=	secnote.c
     10 
     11 CFLAGS+=-Wall -Wextra -Werror -Wstrict-prototypes -Wmissing-prototypes
     12 CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
     13 CFLAGS+=-Wsign-compare -std=c99 -pedantic
     14 CFLAGS+=-fstack-protector-all
     15 CFLAGS+=$(shell pkg-config openssl --cflags)
     16 
     17 LDFLAGS+=$(shell pkg-config openssl --libs)
     18 
     19 OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)
     20 ifeq ("$(OSNAME)", "linux")
     21 	CFLAGS+=-D_GNU_SOURCE
     22 	LDFLAGS+=-lbsd
     23 endif
     24 
     25 OBJS=	$(SRC:%.c=%.o)
     26 
     27 all: $(BIN)
     28 
     29 $(BIN): $(OBJS)
     30 	$(CC) $(OBJS) $(LDFLAGS) -o $(BIN)
     31 
     32 install:
     33 	mkdir -p $(INSTALL_DIR)
     34 	install -m 555 $(BIN) $(INSTALL_DIR)/$(BIN)
     35 
     36 %.o: %.c
     37 	$(CC) $(CFLAGS) -c $< -o $@
     38 
     39 clean:
     40 	rm -rf $(BIN) $(OBJS)
     41 
     42 .PHONY: all clean