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