2 # Makefile for libulz (stolen from musl) (requires GNU make)
4 # Use config.mak to override any of the following variables.
5 # Do not make changes here.
9 exec_prefix = $(prefix)
10 bindir = $(exec_prefix)/bin
11 includedir = $(prefix)/include
12 libdir = $(prefix)/lib
14 SRCS
= $(sort $(wildcard src
/*/*.c
))
16 LOBJS
= $(OBJS
:.o
=.lo
)
21 #-ffreestanding -std=c99 -D_XOPEN_SOURCE=700 -pipe
22 #LDFLAGS = -nostdlib -shared -fPIC -Wl,-e,_start -Wl,-Bsymbolic-functions
25 AR
= $(CROSS_COMPILE
)ar
26 RANLIB
= $(CROSS_COMPILE
)ranlib
27 OBJCOPY
= $(CROSS_COMPILE
)objcopy
29 ALL_INCLUDES
= $(sort $(wildcard include/*.h
include/*/*.h
))
31 ULZ_LIBS
= lib
/libulz.a
32 ALL_LIBS
= $(ULZ_LIBS
)
36 CFLAGS
+= $(CFLAGS_REQ
)
40 install: $(ALL_LIBS
:lib
/%=$(DESTDIR
)$(libdir)/%) $(ALL_INCLUDES
:include/%=$(DESTDIR
)$(includedir)/ulz
/%) $(ALL_TOOLS
:tools
/%=$(DESTDIR
)$(bindir)/%)
46 rm -f
$(ALL_LIBS
) lib
/*.
[ao
] lib
/*.so
49 $(CC
) $(CFLAGS
) $(INC
) -c
-o
$@
$<
59 $(DESTDIR
)$(includedir)/ulz
%: include/%
62 $(DESTDIR
)$(bindir)/%: tools
/%
65 $(DESTDIR
)$(prefix)/%: %
66 install -D
-m
644 $< $@
68 .PHONY
: all clean install