-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (33 loc) · 1.18 KB
/
Makefile
File metadata and controls
49 lines (33 loc) · 1.18 KB
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
CC = gcc
CFLAGS = $(CFLAGS_RELEASE)
LDFLAGS = $(LDFLAGS_RELEASE)
CFLAGS_DEBUG = -O1 -g -Wall -Wextra -std=c11 -pedantic -fsanitize=address,undefined
LDFLAGS_DEBUG = -fsanitize=address,undefined
CFLAGS_RELEASE = -O2 -Wall -Wextra -std=c11
LDFLAGS_RELEASE =
MOD2H_OBJS = mod2h.o mod_file.o
MOD2WAV_OBJS = mod2wav.o mod_file.o wav_file.o mod_play.o
DUMP_SAMPLES_OBJS = dump_samples.o mod_file.o wav_file.o
SHOWMIDI_OBJS = showmidi.o midi_data.o midi_file.o
MIDI2MOD_OBJS = midi2mod.o midi_data.o midi_file.o mod_file.o
ALL = mod2h mod2wav dump_samples midi2mod showmidi
.PHONY: all clean release debug
all: $(ALL)
release:
$(MAKE) "CFLAGS=$(CFLAGS_RELEASE)" "LDFLAGS=$(LDFLAGS_RELEASE)" $(ALL)
debug:
$(MAKE) "CFLAGS=$(CFLAGS_DEBUG)" "LDFLAGS=$(LDFLAGS_DEBUG)" $(ALL)
clean:
rm -f *.o *~ $(ALL)
mod2h: $(MOD2H_OBJS)
$(CC) $(LDFLAGS) -o $@ $(MOD2H_OBJS)
mod2wav: $(MOD2WAV_OBJS)
$(CC) $(LDFLAGS) -o $@ $(MOD2WAV_OBJS)
dump_samples: $(DUMP_SAMPLES_OBJS)
$(CC) $(LDFLAGS) -o $@ $(DUMP_SAMPLES_OBJS)
showmidi: $(SHOWMIDI_OBJS)
$(CC) $(LDFLAGS) -o $@ $(SHOWMIDI_OBJS)
midi2mod: $(MIDI2MOD_OBJS)
$(CC) $(LDFLAGS) -o $@ $(MIDI2MOD_OBJS) -lm
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<