forked from sjlongland/atinysynth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 1.03 KB
/
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
34
35
36
37
38
39
40
41
42
# Compiler definitions
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
INCLUDES ?=
LIBS ?=
PORT ?= pc
BINDIR ?= bin/$(PORT)
PORTDIR ?= ports/$(PORT)
OBJDIR ?= obj/$(PORT)
OBJECTS :=
SRCDIR ?= $(PWD)
.PHONY: setfuse all clean
-include local.mk
include $(PORTDIR)/Makefile
$(BINDIR)/synth: $(OBJECTS) $(OBJDIR)/poly.a
@[ -d $(BINDIR) ] || mkdir -p $(BINDIR)
$(CC) -g -o $@ $(LDFLAGS) $(LIBS) $^
$(OBJDIR)/poly.a: $(OBJDIR)/adsr.o $(OBJDIR)/waveform.o $(OBJDIR)/mml.o $(OBJDIR)/sequencer.o $(OBJDIR)/sequencer_compiler.o $(OBJDIR)/codegen.o
$(AR) rcs $@ $^
$(OBJDIR)/%.o: $(SRCDIR)/%.c
@[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
$(CC) -o $@ -c $(CPPFLAGS) $(INCLUDES) $(CFLAGS) $<
$(CC) -MM $(CPPFLAGS) $(INCLUDES) $< \
| sed -e '/^[^ ]\+:/ s:^:$(OBJDIR)/:g' > [email protected]
$(OBJDIR)/%.o: $(PORTDIR)/%.c
@[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
$(CC) -o $@ -c $(CPPFLAGS) $(INCLUDES) $(CFLAGS) $<
$(CC) -MM $(CPPFLAGS) $(INCLUDES) $< \
| sed -e '/^[^ ]\+:/ s:^:$(OBJDIR)/:g' > [email protected]
clean:
-rm -fr $(OBJDIR) $(BINDIR)
-include $(OBJDIR)/*.dep