2015-12-11 19:22:07 -06:00
|
|
|
# 16 october 2015
|
|
|
|
|
|
|
|
ifndef inlibuibuild
|
|
|
|
$(error Do not run these makefiles directly.)
|
|
|
|
endif
|
|
|
|
ifndef EXAMPLE
|
|
|
|
$(error You must specify an example to build by adding EXAMPLE=name to the command line.)
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(OS)/GNUosspecific.mk
|
|
|
|
|
2016-05-12 11:50:05 -05:00
|
|
|
ifneq ($(findstring cpp-,$(EXAMPLE)),)
|
|
|
|
CXXFILES += \
|
|
|
|
examples/$(EXAMPLE)/main.cpp
|
|
|
|
else
|
2015-12-11 19:22:07 -06:00
|
|
|
CFILES += \
|
|
|
|
examples/$(EXAMPLE)/main.c
|
2016-05-12 11:50:05 -05:00
|
|
|
endif
|
2015-12-11 19:22:07 -06:00
|
|
|
|
|
|
|
HFILES += \
|
|
|
|
ui.h
|
|
|
|
|
2015-12-31 19:12:14 -06:00
|
|
|
ifeq ($(OS),windows)
|
|
|
|
RCFILES += \
|
|
|
|
examples/resources.rc
|
|
|
|
endif
|
|
|
|
|
2015-12-11 19:22:07 -06:00
|
|
|
NAME = $(EXAMPLE)
|
|
|
|
SUFFIX = $(EXESUFFIX)
|
|
|
|
|
|
|
|
# TODO merge with the one in build/GNUmakefile.test
|
|
|
|
ifeq ($(TOOLCHAIN),gcc)
|
|
|
|
LDFLAGS += -L$(OUTDIR) -lui
|
2015-12-19 15:56:45 -06:00
|
|
|
# see build/GNUmakefile.test
|
|
|
|
ifeq ($(OS),darwin)
|
2016-05-14 22:44:07 -05:00
|
|
|
LDFLAGS += -Wl,-rpath,@executable_path/
|
2015-12-19 15:56:45 -06:00
|
|
|
else
|
|
|
|
LDFLAGS += -Wl,-rpath,'$$ORIGIN'
|
|
|
|
endif
|
2016-05-13 20:00:12 -05:00
|
|
|
ifneq ($(findstring cpp-,$(EXAMPLE)),)
|
|
|
|
LDFLAGS += -pthread
|
|
|
|
endif
|
2015-12-11 19:22:07 -06:00
|
|
|
else
|
|
|
|
# TODO is there an equivalent to -L?
|
|
|
|
LDFLAGS += $(OUTDIR)/libui.lib
|
|
|
|
endif
|
|
|
|
|
2016-01-05 10:51:36 -06:00
|
|
|
# executables are not shared libraries
|
|
|
|
USESSONAME = 0
|
|
|
|
|
2015-12-11 19:22:07 -06:00
|
|
|
include build/GNUbase$(TOOLCHAIN).mk
|