summaryrefslogtreecommitdiffstats
path: root/lib/mp3guessenc-0.27.4/Makefile
blob: 47ad9b76752d7e4bb1bb9f7d378a2405381c40c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#
# Makefile
#
# If you wish, you can edit to suit your system.
#

# choose build type
BUILD = release
#BUILD = debug

# choose the target OS - `other' is good for both *nix, win32 systems and haiku
# 64 bit as well.
# NOTE: in haiku 32 bit with gcc2 some options need to be avoided since the compiler
# is quite old (gcc-2.95.3), with gcc4/5 the selected options won't raise any
# issue. If uncertain, select `haiku32_gcc2'
# UPDATE: the most recent nightly builds of haiku 32 bit adopted a different
# compiler naming scheme after suppressing the `setgcc' utility. Now gcc2 is
# called `gcc' and gcc4/5 is called `gcc-x86' and this Makefile is smart enough
# to set the right compiler name for you.
TARGET_OS = other
#TARGET_OS = haiku32_gcc2
#TARGET_OS = haiku32_gcc4

# here you can edit the installation path (only one will be used)
# On *nix systems you may want to have mp3guessenc installed under /usr/local
# In Haiku it is useful to put executables under /boot/home/config/non-packaged
PREFIX = /usr/local
#PREFIX = /boot/home/config/non-packaged

# common preferences
CC = gcc
#CC = tcc
#CC = clang
CFLAGS = -Wall
LDFLAGS =
LIBS =

# no need to change anything below here
#--------------------------------------

# is make running into windows?
ifdef SYSTEMROOT
  BIN_EXT = .exe
else
  BIN_EXT =
endif

ifeq ($(TARGET_OS),haiku32_gcc4)
  ifeq ($(CC),gcc)
    CC = gcc-x86
  endif
endif

ifneq ($(TARGET_OS),haiku32_gcc2)
  CFLAGS += -Wextra -fsingle-precision-constant
endif

ifeq ($(BUILD),release)
  CFLAGS += -O2
  LDFLAGS += -s
else
  CFLAGS += -g
  ifneq ($(TARGET_OS),haiku32_gcc2)
    CFLAGS += -fno-stack-protector
  endif
endif

SRC0 = mp3guessenc.c bit_utils.c tags.c decode.c
OBJ0 = mp3guessenc.o bit_utils.o tags.o decode.o

all: $(OBJ0) mp3guessenc
make: all

mp3guessenc: $(OBJ0)
	gcc $(LDFLAGS) -o mp3guessenc$(BIN_EXT) $(OBJ0) $(LIBS)

mp3guessenc.o: mp3guessenc.c mp3guessenc.h bit_utils.h tags.h decode.h scrambled.h mp3g_io_config.h
bit_utils.o: bit_utils.c bit_utils.h mp3g_io_config.h
tags.o: tags.c tags.h mp3guessenc.h mp3g_io_config.h
decode.o: decode.c

install:
	mkdir -p $(PREFIX)/bin
	cp -v -f mp3guessenc$(BIN_EXT) $(PREFIX)/bin/

clean:
	rm -f $(OBJ0) mp3guessenc$(BIN_EXT)

distclean: clean

uninstall:
	rm $(PREFIX)/bin/mp3guessenc$(BIN_EXT)