forked from vampirefrog/mdxtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (32 loc) · 1.02 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
CFLAGS=-ggdb -Wall
PROGS=mdxstat vgmtest mdxdump mdx2mml pdx2wav pdx2sf2 mdx2vgm mdx2opm mdx2midi mididump midi2json mml2mdx
all: $(PROGS)
ifneq (,$(findstring MINGW,$(shell uname -s)))
LIBS=-lz -liconv -lws2_32
else
LIBS=-lz
endif
.SECONDEXPANSION:
mdxdump_SRCS=tools.cpp MDX.cpp
pdx2wav_SRCS=tools.cpp
pdx2sf2_SRCS=tools.cpp Soundfont.c
mididump_SRCS=tools.cpp
midi2json_SRCS=tools.cpp
mdx2vgm_SRCS=tools.cpp MDX.cpp Stream.cpp
mdx2mml_SRCS=tools.cpp MDX.cpp
mdx2opm_SRCS=tools.cpp MDX.cpp
mdx2midi_SRCS=tools.cpp MDX.cpp Stream.cpp
mdxstat_SRCS=MDX.cpp
vgmtest_SRCS=Stream.cpp
mml2mdx_SRCS=tools.cpp MML.cpp mml2mdx.cpp Stream.cpp
OBJS=$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(foreach prog,$(PROGS),$(prog).cpp $($(prog)_SRCS))))
$(OBJS): Makefile
$(PROGS): $$(sort $$@.o $$(patsubst %.c,%.o,$$(patsubst %.cpp,%.o,$$($$@_SRCS))))
$(CXX) $^ -o $@ $(CFLAGS) $(LIBS)
%.o: %.cpp
$(CXX) -MMD -c $< -o $@ $(CFLAGS)
%.o: %.c
$(CC) -MMD -c $< -o $@ $(CFLAGS)
-include $(OBJS:.o=.d)
clean:
rm -f $(PROGS) $(addsuffix .exe,$(PROGS)) *.o *.d