From f4c7c168b6eefae0b3ddd9009c03988c3bea2cd8 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Tue, 21 Dec 2021 15:20:12 +0100 Subject: [PATCH] Replaced with latest versions --- Makefile | 15 ++++++++++++--- premake.make | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 22f5397..7a03e23 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ ifeq ($(UNAME_S),Linux) $(CXX) -g -shared -Wl,-soname,$(SONAME) -o $(OUTDIR)$(REALNAME) $(LDFLAGS) $(LDLIBS) $(addprefix $(BUILDDIR),$(OBJS)) endif -%.o: %.cpp %.d Makefile +%.o: %.cpp %.d $(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.d -c $< @mv $@ $*.d $(BUILDDIR) @@ -81,6 +81,7 @@ endif $(OUTDIR)$(STATICLIB): $(OBJS) ar r $(OUTDIR)$(STATICLIB) $(addprefix $(BUILDDIR),$(OBJS)) +ifeq ($(GENERATELIBHEADER),1) $(LIBNAME).hpp: $(HDRS) @echo updating build/$(LIBNAME).hpp @cp /dev/null build/$(LIBNAME).hpp @@ -88,6 +89,10 @@ $(LIBNAME).hpp: $(HDRS) do \ cat $$h >> build/$(LIBNAME).hpp; \ done +HEADERSRCDIR := build +else +HEADERSRCDIR := src +endif test: $(MAKE) -C tests && tests/tests @@ -96,11 +101,15 @@ clean: $(RM) build $(MAKE) -C tests clean -install: $(OUTDIR)$(REALNAME) $(LIBNAME).hpp +ifeq ($(GENERATELIBHEADER),1) +install: $(LIBNAME).hpp +else +install: +endif $(INSTALL) -d $(LIBDIR) $(INSTALL) -m 644 $(OUTDIR)$(REALNAME) $(LIBDIR) $(INSTALL) -d $(INCLUDEDIR) - $(INSTALL) -m 644 build/$(LIBNAME).hpp $(INCLUDEDIR) + $(INSTALL) -m 644 $(HEADERSRCDIR)/$(LIBNAME).hpp $(INCLUDEDIR) ifeq ($(UNAME_S),Darwin) cd $(LIBDIR) && ln -sf $(REALNAME) $(SONAME) endif diff --git a/premake.make b/premake.make index 1c9e144..1e7b440 100644 --- a/premake.make +++ b/premake.make @@ -3,3 +3,5 @@ LDLIBS := -lcairo -lscnumerics MAJOR := 1 MINOR := 0 PATCH := 0 + +GENERATELIBHEADER := 1