diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -3,21 +3,31 @@ ABI_VERSION := 0 SONAME := libuniso.so.$(ABI_VERSION) OBJS := libuniso.o +TARGETS := $(SONAME) libuniso.so uniso CFLAGS ?= -g -Wall CFLAGS += -fPIC +CFLAGS += -I. -all: libuniso.so +uniso_OBJS := uniso.o +uniso_LIBS := -luniso +uniso_LDFLAGS += -L. + +all: $(TARGETS) $(SONAME): $(OBJS) - $(CC) -shared -Wl,-soname,$(SONAME) -o $@ + $(CC) -shared -Wl,-soname,$(SONAME) $(LDFLAGS) $($@_LDFLAGS) -o $@ $^ libuniso.so: $(SONAME) ln -s $< $@ %.o: %.c - $(CC) $(CFLAGS) -c $^ + $(CC) $(CFLAGS) $($@_CFLAGS) -c $^ + +uniso: $(uniso_OBJS) libuniso.so + $(CC) $(LDFLAGS) -o $@ $($@_OBJS) $($@_LIBS) clean: - rm -f libuniso.so libuniso.so.$(ABI_VERSION) *.o + rm -f $(TARGETS) *.o + |