summaryrefslogtreecommitdiffstats
path: root/src/Makefile
blob: a8853be383a23b0252b2c9084fd8d0fa8a69fb62 (plain)
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
43
44
45
46
47
48
49
include ../mk/build.mk

INCLUDE_PATH	= ../include
HEADERS_SUBDIR	= xas

CC		 = $(CROSS)cc
CFLAGS		+= -I$(INCLUDE_PATH)
LDFLAGS		+=

HEADERS		= audio.h mixer.h synth.h riff.h

OBJS		= audio.o mixer.o synth.o 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)