OLD | NEW |
1 ifndef CC | 1 CC ?= gcc |
2 CC = gcc | |
3 endif | |
4 | |
5 CFLAGS = $(CCFLAGS) \ | |
6 » -lm \ | |
7 » -Werror \ | |
8 » -O2 \ | |
9 » -m32 | |
10 | 2 |
11 C_SRCS = src/filterkit.c src/resample.c src/resamplesubs.c | 3 C_SRCS = src/filterkit.c src/resample.c src/resamplesubs.c |
12 HEADERS = include/libresample.h src/config.h src/filterkit.h src/resample_defs.h | 4 HEADERS = include/libresample.h src/config.h src/filterkit.h src/resample_defs.h |
13 | 5 |
14 all: clean dirs resample_lib | 6 all: clean dirs libresample.a |
15 @echo "Done building." | 7 @echo "Done building." |
16 | 8 |
17 clean: | 9 clean: |
18 rm -rf libresample.a objs/ | 10 rm -rf libresample.a objs/ |
19 | 11 |
20 dirs: | 12 dirs: |
21 test -d objs/src || mkdir -p objs/src | 13 test -d objs/src || mkdir -p objs/src |
22 | 14 |
23 C_OBJS = $(C_SRCS:%.c=objs/%.o) | 15 C_OBJS = $(C_SRCS:%.c=objs/%.o) |
24 | 16 |
25 $(C_OBJS): objs/%.o: %.c $(HEADERS) | 17 $(C_OBJS): objs/%.o: %.c $(HEADERS) |
26 $(CC) -c $(CFLAGS) -fPIC -Iobjs/ $< -o $@ | 18 $(CC) -c $(CFLAGS) -fPIC -Iobjs/ $< -o $@ |
27 | 19 |
28 resample_lib: $(C_OBJS) | 20 libresample.a: $(C_OBJS) |
29 » ar rcs libresample.a \ | 21 » $(AR) rcs $@ $^ |
30 » $(C_OBJS) | |
31 | |
OLD | NEW |