summaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..c00ccc0
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,49 @@
+include ../mk/build.mk
+
+INCLUDE_PATH = ../include
+HEADERS_SUBDIR = xas
+
+CC = $(CROSS)cc
+CFLAGS += -I$(INCLUDE_PATH)
+LDFLAGS +=
+
+HEADERS = riff.h audio.h
+
+OBJS = riff.o
+
+VERSION_MAJOR = 0
+VERSION_MINOR = 0.1
+VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
+
+LIBNAME = xas
+
+HEADERS_BUILD = $(addprefix $(INCLUDE_PATH)/$(HEADERS_SUBDIR)/, $(HEADERS))
+
+all: $(STATIC) $(SONAME_FULL) $(SONAME) $(SONAME_SHORT)
+
+$(STATIC): $(OBJS)
+ $(AR) rc $(STATIC) $(OBJS)
+ $(RANLIB) $(STATIC)
+
+$(SONAME_FULL): $(OBJS)
+ $(CC) $(LDFLAGS_SO) -o $(SONAME_FULL) $(OBJS) $(LDFLAGS)
+
+$(SONAME): $(SONAME_FULL)
+ $(LN) -s $< $@
+
+$(SONAME_SHORT): $(SONAME_FULL)
+ $(LN) -s $< $@
+
+$(OBJS): %.o: %.c $(HEADERS_BUILD)
+ $(CC) $(CFLAGS) -c $<
+
+install: $(SONAME_FULL) $(STATIC)
+ $(INSTALL) -c -m 0644 $(STATIC) $(PREFIX)/lib
+ $(INSTALL) -c -m 0755 $(SONAME_FULL) $(PREFIX)/lib
+ $(LN) -s -f $(SONAME_FULL) $(PREFIX)/lib/$(SONAME)
+ $(LN) -s -f $(SONAME_FULL) $(PREFIX)/lib/$(SONAME_SHORT)
+ $(INSTALL) -d -m 0755 $(PREFIX)/include/$(HEADERS_SUBDIR)
+ $(INSTALL) -c -m 0644 $(HEADERS_BUILD) $(PREFIX)/include/$(HEADERS_SUBDIR)
+
+clean:
+ $(RM) -f $(SONAME_SHORT) $(SONAME) $(SONAME_FULL) $(STATIC) $(OBJS)