Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Makefile for klick, by B. Watson (yalhcru@gmail.com). Part of
  2. # SlackBuilds.org build for klick.
  3. # Wrote this because the SConstruct for klick no longer works in
  4. # modern scons, and I'm way better at Makefiles than I am at scons.
  5. # This is the bare minimum needed to build klick. There are no clean
  6. # or install targets, and there's no dependency info for headers.
  7. PROJ=klick
  8. VERSION=0.12.2
  9. TERMINAL=yes
  10. OSC=no
  11. RUBBERBAND=no
  12. SLKCFLAGS=
  13. PREFIX=/usr
  14. SHARE=$(PREFIX)/share/$(PROJ)
  15. SRCS=src/main.cc src/klick.cc src/options.cc src/audio_interface.cc src/audio_interface_jack.cc src/audio_interface_sndfile.cc src/audio_chunk.cc src/tempomap.cc src/metronome.cc src/metronome_simple.cc src/metronome_map.cc src/metronome_jack.cc src/position.cc src/util/util.cc
  16. LIBS:=$(shell pkg-config --libs jack samplerate sndfile)
  17. FLAGS:=$(shell pkg-config --cflags jack samplerate sndfile)
  18. ifeq ($(TERMINAL),yes)
  19. SRCS+=src/terminal_handler.cc
  20. DEFS+= -DENABLE_TERMINAL
  21. endif
  22. ifeq ($(OSC),yes)
  23. SRCS+=src/osc_interface.cc src/osc_handler.cc
  24. LIBS+= $(shell pkg-config --libs liblo)
  25. FLAGS+= $(shell pkg-config --cflags liblo)
  26. DEFS+= -DENABLE_OSC
  27. endif
  28. ifeq ($(RUBBERBAND),yes)
  29. LIBS+= $(shell pkg-config --libs rubberband)
  30. FLAGS+= $(shell pkg-config --cflags rubberband)
  31. DEFS+= -DENABLE_RUBBERBAND
  32. endif
  33. DEFS+= -DHAVE_SNDFILE_OGG -DNDEBUG -DDATA_DIR='"$(SHARE)"' -DVERSION='"$(VERSION)"'
  34. CXXFLAGS=-fpermissive $(SLKCFLAGS) $(DEFS) $(FLAGS)
  35. OBJS=$(SRCS:.cc=.o)
  36. all: $(PROJ)
  37. $(PROJ): $(OBJS)
  38. $(CXX) -o $(PROJ) $(OBJS) $(LDFLAGS) $(LIBS)
  39. $(OBJS): $(SRCS)