kore

Kore is a web application platform for writing scalable, concurrent web based processes in C or Python.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

Makefile (1310B)



      1 # kodev Makefile
      2 
      3 CC?=cc
      4 PREFIX?=/usr/local
      5 OBJDIR?=obj
      6 KODEV=kodev
      7 DESTDIR?=
      8 INSTALL_DIR=$(PREFIX)/bin
      9 
     10 S_SRC=	../src/cli.c
     11 
     12 CFLAGS+=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
     13 CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
     14 CFLAGS+=-Wsign-compare -Iincludes -std=c99 -pedantic
     15 CFLAGS+=-DPREFIX='"$(PREFIX)"'
     16 LDFLAGS=-lcrypto
     17 
     18 ifneq ("$(NOOPT)", "")
     19 	CFLAGS+=-O0
     20 else
     21 	CFLAGS+=-O2
     22 endif
     23 
     24 ifneq ("$(MINIMAL)", "")
     25 	CFLAGS+=-DKODEV_MINIMAL
     26 	LDFLAGS=
     27 endif
     28 
     29 ifneq ("$(OPENSSL_PATH)", "")
     30 	CFLAGS+=-I$(OPENSSL_PATH)/include
     31 	LDFLAGS+=-L$(OPENSSL_PATH)/lib -lcrypto
     32 endif
     33 
     34 OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)
     35 ifeq ("$(OSNAME)", "darwin")
     36 	CFLAGS+=$(shell pkg-config openssl --cflags)
     37 	LDFLAGS+=$(shell pkg-config openssl --libs)
     38 else ifeq ("$(OSNAME)", "linux")
     39 	CFLAGS+=-D_GNU_SOURCE=1
     40 endif
     41 
     42 S_OBJS=	$(S_SRC:../src/%.c=$(OBJDIR)/%.o)
     43 
     44 $(KODEV): $(OBJDIR) $(S_OBJS)
     45 	$(CC) $(S_OBJS) $(LDFLAGS) -o $(KODEV)
     46 
     47 $(OBJDIR):
     48 	@mkdir -p $(OBJDIR)
     49 
     50 install: $(KODEV)
     51 	mkdir -p $(DESTDIR)$(INSTALL_DIR)
     52 	install -m 555 $(KODEV) $(DESTDIR)$(INSTALL_DIR)/$(KODEV)
     53 
     54 uninstall:
     55 	rm -f $(DESTDIR)$(INSTALL_DIR)/$(KODEV)
     56 
     57 $(OBJDIR)/%.o: ../src/%.c
     58 	$(CC) $(CFLAGS) -c $< -o $@
     59 
     60 clean:
     61 	find . -type f -name \*.o -exec rm {} \;
     62 	rm -rf $(KODEV) $(OBJDIR)
     63 
     64 .PHONY: all clean