-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (24 loc) · 700 Bytes
/
Makefile
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
CC=gcc
CFLAGS_COMMON=-std=c99 -pedantic -Wall -Wno-unused-variable -Wdeclaration-after-statement
CFLAGS=-O0 -g $(CFLAGS_COMMON)
LDFLAGS=-lm
OBJECTS=obj/main.o obj/midi.o obj/chip16.o
.PHONY: all clean debug
all: midi16 tags
debug: CFLAGS=-O0 -g -DDEBUG_EVENTS $(CFLAGS_COMMON)
debug: midi16 tags
tags: midi16
ctags -R .
midi16: $(OBJECTS)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
obj/main.o: src/main.c src/midi.h
@mkdir -p obj
$(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS)
obj/midi.o: src/midi.c src/midi.h
@mkdir -p obj
$(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS)
obj/chip16.o: src/chip16.c src/midi.h src/chip16.h
@mkdir -p obj
$(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS)
clean:
@rm -rf obj midi16