summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 22b3eb7c768ff9d1bbfdf090373bf2f475d393d7 (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

ABI_VERSION := 0
SONAME := libuniso.so.$(ABI_VERSION)
OBJS := libuniso.o

TARGETS := $(SONAME) libuniso.so uniso

CFLAGS ?= -g -Wall 
CFLAGS += -fPIC
CFLAGS += -I.

uniso_OBJS := uniso.o
uniso_LIBS := -luniso
uniso_LDFLAGS += -L.

all:	$(TARGETS)

$(SONAME): $(OBJS)
	$(CC) -shared -Wl,-soname,$(SONAME) $(LDFLAGS) $($@_LDFLAGS) -o $@ $^

libuniso.so: $(SONAME)
	ln -s $< $@

%.o: %.c
	$(CC) $(CFLAGS) $($@_CFLAGS) -c $^

uniso: $(uniso_OBJS) libuniso.so
	$(CC) $(LDFLAGS) -o $@ $($@_OBJS) $($@_LIBS)

clean:
	rm -f $(TARGETS) *.o