2016-08-29 01:20:40 +04:00
|
|
|
TARGET := examples
|
|
|
|
SRCDIR := examples
|
|
|
|
|
|
|
|
CC ?= gcc
|
|
|
|
LIBS := ../lib/libmodest_static.a
|
|
|
|
|
|
|
|
INCLUDE_TMP := include
|
|
|
|
|
|
|
|
MODEST_OPTIMIZATION_LEVEL ?= -O2
|
|
|
|
|
|
|
|
CFLAGS ?= -Wall -Werror
|
2017-02-21 21:26:36 +01:00
|
|
|
CFLAGS += $(MODEST_OPTIMIZATION_LEVEL) -Wno-unused-variable --std=c99 -I../include
|
|
|
|
|
|
|
|
ifneq ($(OS),Windows_NT)
|
|
|
|
CFLAGS += -fPIC
|
|
|
|
endif
|
2016-08-29 01:20:40 +04:00
|
|
|
|
2016-08-29 01:45:53 +04:00
|
|
|
MODEST_BUILD_WITHOUT_THREADS ?= NO
|
|
|
|
ifeq ($(MODEST_BUILD_WITHOUT_THREADS),YES)
|
|
|
|
$(info Build Examples without POSIX Threads)
|
|
|
|
else
|
|
|
|
$(info Build Examples with POSIX Threads)
|
|
|
|
CFLAGS += -pthread
|
|
|
|
endif
|
|
|
|
|
2017-03-01 21:21:57 +01:00
|
|
|
LDLIBS += $(LIBS)
|
|
|
|
|
2016-10-23 16:09:32 +03:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
else
|
|
|
|
UNAM := $(shell uname -s)
|
|
|
|
ifeq ($(UNAM),Darwin)
|
|
|
|
else
|
|
|
|
CFLAGS += -D_POSIX_C_SOURCE=199309L
|
|
|
|
endif
|
2017-03-01 21:09:36 +03:00
|
|
|
|
2017-03-01 21:21:57 +01:00
|
|
|
LDLIBS += -lm
|
2016-10-23 16:09:32 +03:00
|
|
|
endif
|
|
|
|
|
2016-08-29 01:20:40 +04:00
|
|
|
find_files_h = $(wildcard $(dir)/*.h)
|
|
|
|
find_files_c = $(wildcard $(dir)/*.c)
|
|
|
|
|
2017-03-01 21:09:36 +03:00
|
|
|
SUBDIRS := selectors declarations myfont modest mycss myhtml myurl
|
2016-08-29 01:20:40 +04:00
|
|
|
HDRS += $(foreach dir,$(SUBDIRS),$(find_files_h))
|
|
|
|
SRCS += $(foreach dir,$(SUBDIRS),$(find_files_c))
|
|
|
|
|
|
|
|
OBJS := $(patsubst %.c,%,$(SRCS))
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
cp -r $(OBJS) ../bin/
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS)
|
|
|
|
|
2017-02-21 21:26:36 +01:00
|
|
|
.PHONY: all
|