1
0
mirror of https://git.kore.io/kore.git synced 2024-11-12 05:10:48 +01:00
kore/kodev/Makefile
Joris Vink ca17e08ad9 Add MIMINAL=1 build to kodev.
If the kodev tool is built with MINIMAL=1 it will not compile in
support for creating application skeletons, only to build apps, etc.

Building with MINIMAL=1 drops the openssl linkage.
2019-10-31 09:44:47 +01:00

59 lines
1.2 KiB
Makefile

# kodev Makefile
CC?=cc
PREFIX?=/usr/local
OBJDIR?=obj
KODEV=kodev
INSTALL_DIR=$(PREFIX)/bin
S_SRC= ../src/cli.c
CFLAGS+=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS+=-Wsign-compare -Iincludes -std=c99 -pedantic
CFLAGS+=-DPREFIX='"$(PREFIX)"'
LDFLAGS=-lcrypto
ifneq ("$(NOOPT)", "")
CFLAGS+=-O0
else
CFLAGS+=-O2
endif
ifneq ("$(MINIMAL)", "")
CFLAGS+=-DKODEV_MINIMAL
LDFLAGS=
endif
OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)
ifeq ("$(OSNAME)", "darwin")
CFLAGS+=-I/opt/local/include/ -I/usr/local/opt/openssl/include
LDFLAGS+=-L/opt/local/lib -L/usr/local/opt/openssl/lib
else ifeq ("$(OSNAME)", "linux")
CFLAGS+=-D_GNU_SOURCE=1
endif
S_OBJS= $(S_SRC:../src/%.c=$(OBJDIR)/%.o)
$(KODEV): $(OBJDIR) $(S_OBJS)
$(CC) $(S_OBJS) $(LDFLAGS) -o $(KODEV)
$(OBJDIR):
@mkdir -p $(OBJDIR)
install: $(KODEV)
mkdir -p $(INSTALL_DIR)
install -m 555 $(KODEV) $(INSTALL_DIR)/$(KODEV)
uninstall:
rm -f $(INSTALL_DIR)/$(KODEV)
$(OBJDIR)/%.o: ../src/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
find . -type f -name \*.o -exec rm {} \;
rm -rf $(KODEV) $(OBJDIR)
.PHONY: all clean