Makefile 1.6 KB

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