add support for RcB2 build sys
[rofl0r-c-flod.git] / Makefile
blob6ac9ba5cff8f265af94806d28ec40bc730a8fccc
2 # Makefile for libulz (stolen from musl) (requires GNU make)
4 # Use config.mak to override any of the following variables.
5 # Do not make changes here.
8 exec_prefix = /usr/local
9 bindir = $(exec_prefix)/bin
11 prefix = /usr/local/
12 includedir = $(prefix)/include
13 libdir = $(prefix)/lib
16 FLASH_SRCS = $(sort $(wildcard flashlib/*.c))
17 CORE_SRCS = $(sort $(wildcard neoart/flod/core/*.c))
18 BACKEND_SRCS = $(sort $(wildcard backends/*.c))
20 TRACKER_SRCS = $(sort $(wildcard neoart/flod/trackers/*.c))
21 FASTTRACKER_SRCS = $(sort $(wildcard neoart/flod/fasttracker/*.c))
22 WHITTAKER_SRCS = $(sort $(wildcard neoart/flod/whittaker/*.c))
23 FUTURECOMPOSER_SRCS = $(sort $(wildcard neoart/flod/futurecomposer/*.c))
24 DIGITALMUGICIAN_SRCS = $(sort $(wildcard neoart/flod/digitalmugician/*.c))
25 SIDMON_SRCS = $(sort $(wildcard neoart/flod/sidmon/*.c))
26 SOUNDFX_SRCS = $(sort $(wildcard neoart/flod/soundfx/*.c))
27 BPSOUNDMON_SRCS = $(sort $(wildcard neoart/flod/soundmon/*.c))
28 HUBBARD_SRCS = $(sort $(wildcard neoart/flod/hubbard/*.c))
29 FREDED_SRCS = $(sort $(wildcard neoart/flod/fred/*.c))
30 HIPPEL_SRCS = $(sort $(wildcard neoart/flod/hippel/*.c))
31 DELTA_SRCS = $(sort $(wildcard neoart/flod/deltamusic/*.c))
33 ALL_PLAYER_SRCS = $(WHITTAKER_SRCS) $(FUTURECOMPOSER_SRCS) $(TRACKER_SRCS) \
34 $(FASTTRACKER_SRCS) $(DIGITALMUGICIAN_SRCS) $(SIDMON_SRCS) $(SOUNDFX_SRCS) \
35 $(BPSOUNDMON_SRCS) $(HUBBARD_SRCS) $(FREDED_SRCS) $(HIPPEL_SRCS) $(DELTA_SRCS)
37 #FILELOADER_SRCS = neoart/flod/FileLoader.c
38 #PLAYER_SRCS = demos/Demo5.c
39 PLAYER_SRCS = $(sort $(wildcard player/*.c))
41 SRCS = $(BACKEND_SRCS) $(FLASH_SRCS) $(CORE_SRCS) $(ALL_PLAYER_SRCS) \
42 $(FILELOADER_SRCS) $(PLAYER_SRCS)
44 OBJS = $(SRCS:.c=.o)
46 CFLAGS += -O0 -g
47 AR = $(CROSS_COMPILE)ar
48 RANLIB = $(CROSS_COMPILE)ranlib
49 OBJCOPY = $(CROSS_COMPILE)objcopy
51 #ALL_INCLUDES = $(sort $(wildcard include/*.h include/*/*.h))
53 #ALL_LIBS = libflod.a
54 ALL_TOOLS = flodplayer
55 #ALL_TOOLS = flod_demo.out
57 -include config.mak
59 all: $(ALL_LIBS) $(ALL_TOOLS)
61 install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%) $(ALL_TOOLS:tools/%=$(DESTDIR)$(bindir)/%)
63 clean:
64 rm -f $(OBJS)
65 rm -f $(ALL_TOOLS)
66 # rm -f $(LOBJS)
67 # rm -f $(ALL_LIBS) lib/*.[ao] lib/*.so
69 %.o: %.c
70 $(CC) $(CFLAGS) $(INC) -c -o $@ $<
72 flodplayer: $(OBJS)
73 $(CC) -o $@ $(OBJS) -lm -lao $(LDFLAGS)
75 flod_demo.out: $(OBJS)
76 $(CC) -o $@ $(OBJS) -lm -lao $(LDFLAGS)
78 libflod.a: $(OBJS)
79 rm -f $@
80 $(AR) rc $@ $(OBJS)
81 $(RANLIB) $@
83 lib/%.o:
84 cp $< $@
86 $(DESTDIR)$(bindir)/%: tools/%
87 install -D $< $@
89 $(DESTDIR)$(prefix)/%: %
90 install -D -m 644 $< $@
92 .PHONY: all clean install