logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

tinymania-fix-Makefile.patch (1204B)


  1. diff --git a/Makefile b/Makefile
  2. index 739c63f..500e8a0 100644
  3. --- a/Makefile
  4. +++ b/Makefile
  5. @@ -1,5 +1,6 @@
  6. # compiler
  7. -CC := g++
  8. +CXX ?= g++
  9. +PREFIX ?= /usr/local
  10. # OS and specific libs
  11. OS := $(shell uname)
  12. @@ -21,23 +23,24 @@ TARGET := tinymania
  13. SRCEXT := cpp
  14. SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
  15. OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
  16. -CFLAGS := -g -std=c++17 -O3 -Wall -Wextra -pedantic
  17. +CXXFLAGS ?= -g -O3 -Wall -Wextra -pedantic
  18. INC := -I include
  19. #specify linked libraries
  20. $(TARGET): $(OBJECTS)
  21. @echo " linking..."
  22. - @echo " $(CC) $^ -o $(TARGET) $(LIB)"; $(CC) $^ -o $(TARGET) $(LIB)
  23. + $(CXX) $^ -o $(TARGET) $(LIB)
  24. $(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
  25. @echo " compiling..."
  26. @mkdir -p $(BUILDDIR)
  27. - @echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $<"; $(CC) $(CFLAGS) $(INC) -c -o $@ $<
  28. + $(CXX) $(CXXFLAGS) -std=c++14 $(INC) -c -o $@ $<
  29. install: $(TARGET)
  30. - cp tinymania /usr/bin/tinymania
  31. + mkdir -p $(DESTDIR)$(PREFIX)/bin
  32. + cp tinymania $(DESTDIR)$(PREFIX)/bin/tinymania
  33. clean:
  34. @echo " cleaning ..."
  35. - @echo " $(RM) -r $(BUILDDIR) $(TARGET)"; $(RM) -r $(BUILDDIR) $(TARGET)
  36. + $(RM) -r $(BUILDDIR) $(TARGET)