# 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 ifneq ($(findstring cpp-,$(EXAMPLE)),) CXXFILES += \ examples/$(EXAMPLE)/main.cpp else CFILES += \ examples/$(EXAMPLE)/main.c endif HFILES += \ ui.h ifeq ($(OS),windows) RCFILES += \ examples/resources.rc ifneq (,$(STATIC)) RCFLAGS += -D _UI_STATIC endif endif NAME = $(EXAMPLE) SUFFIX = $(EXESUFFIX) # TODO merge with the one in build/GNUmakefile.test ifeq ($(TOOLCHAIN),gcc) ifeq (,$(STATIC)) LDFLAGS += -L$(OUTDIR) -lui else LDFLAGS += -L$(OUTDIR) -lui $(NATIVE_UI_LDFLAGS) endif # see build/GNUmakefile.test ifeq ($(OS),darwin) LDFLAGS += -Wl,-rpath,@executable_path/ else LDFLAGS += -Wl,-rpath,'$$ORIGIN' endif ifneq ($(findstring cpp-,$(EXAMPLE)),) LDFLAGS += -pthread endif else ifeq (,$(STATIC)) # TODO is there an equivalent to -L? LDFLAGS += $(OUTDIR)/libui.lib else LDFLAGS += $(OUTDIR)/libui.lib $(OUTDIR)/libui.res $(OUTDIR)/$(NAME).res $(NATIVE_UI_LDFLAGS) endif endif # executables are not shared libraries USESSONAME = 0 include build/GNUbase$(TOOLCHAIN).mk