Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. targets = \
  2. mpg123_test \
  3. feedseek \
  4. mpg123_to_out123 \
  5. mpg123_to_wav_replaced_io \
  6. scan \
  7. id3dump \
  8. mpglib \
  9. dump_seekindex \
  10. extract_frames
  11. all: $(targets)
  12. # On largefile-aware systems you might want to use these instead:
  13. #MPG123_CFLAGS := $(shell pkg-config --cflags libmpg123_64)
  14. #MPG123_LDFLAGS := $(shell pkg-config --libs libmpg123_64)
  15. # This works on sane setups where off_t is off_t, and just that.
  16. ifeq ($(MPG123_PREFIX),)
  17. MPG123_CFLAGS := $(shell pkg-config --cflags libmpg123)
  18. MPG123_LDFLAGS := $(shell pkg-config --libs libmpg123)
  19. OUT123_CFLAGS := $(shell pkg-config --cflags libout123)
  20. OUT123_LDFLAGS := $(shell pkg-config --libs libout123)
  21. else # Yeah, that's with GNU/Linux in mind, at least GNU ld ...
  22. MPG123_CFLAGS := -I$(MPG123_PREFIX)/include
  23. MPG123_LDFLAGS := -L$(MPG123_PREFIX)/lib -Wl,-rpath $(MPG123_PREFIX)/lib -lmpg123
  24. OUT123_CFLAGS := -I$(MPG123_PREFIX)/include
  25. OUT123_LDFLAGS := -L$(MPG123_PREFIX)/lib -Wl,-rpath $(MPG123_PREFIX)/lib -lout123
  26. endif
  27. # Oder of libs not that important here...
  28. compile = $(CC) $(CPPFLAGS) $(CFLAGS) $(MPG123_CFLAGS)
  29. linkflags = $(MPG123_LDFLAGS) $(LDFLAGS)
  30. mpg123_to_out123: mpg123_to_out123.c
  31. $(compile) -o $@ $< $(OUT123_CFLAGS) $(OUT123_LDFLAGS) $(linkflags)
  32. mpg123_to_wav_replaced_io: mpg123_to_wav_replaced_io.c
  33. $(compile) -o $@ $< $(OUT123_CFLAGS) $(OUT123_LDFLAGS) $(linkflags)
  34. feedseek: feedseek.c
  35. $(compile) -o feedseek feedseek.c $(linkflags)
  36. scan: scan.c
  37. $(compile) -o scan scan.c $(linkflags)
  38. id3dump:id3dump.c
  39. $(compile) -o id3dump id3dump.c $(linkflags)
  40. dump_seekindex: dump_seekindex.c
  41. $(compile) -o dump_seekindex dump_seekindex.c $(linkflags)
  42. mpglib: mpglib.c
  43. $(compile) -o mpglib mpglib.c $(linkflags)
  44. mpg123_test: mpg123_test.c
  45. $(compile) -o $@ $< $(linkflags)
  46. extract_frames: extract_frames.c
  47. $(compile) -o $@ $< $(linkflags)
  48. clean:
  49. rm -vf $(targets)