2014-06-28 10:10:20 -04:00
|
|
|
include ../build-aux/platform.mak
|
|
|
|
include ../build-aux/compiler.mak
|
|
|
|
include ../build-aux/version.mak
|
|
|
|
include ../build-aux/dirs.mak
|
2014-04-21 16:37:44 -04:00
|
|
|
|
|
|
|
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
|
2016-02-28 10:46:24 -05:00
|
|
|
CFLAGS?=$(OPTLEVEL)
|
2014-04-21 16:37:44 -04:00
|
|
|
|
|
|
|
CPPFLAGS:=$(CPPFLAGS) -DVERSIONSTR=\"$(VERSION)\"
|
2016-02-28 10:46:24 -05:00
|
|
|
CFLAGS:=$(CFLAGS) -Wall -Wextra
|
|
|
|
|
|
|
|
ifeq ($(HOST_IS_SORTIX),0)
|
|
|
|
CPPFLAGS+=-D_GNU_SOURCE
|
|
|
|
endif
|
2014-04-21 16:37:44 -04:00
|
|
|
|
|
|
|
BINARY:=carray
|
|
|
|
|
|
|
|
all: $(BINARY)
|
|
|
|
|
2014-04-22 09:26:55 -04:00
|
|
|
.PHONY: all install clean
|
2014-04-21 16:37:44 -04:00
|
|
|
|
|
|
|
install: all
|
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
install $(BINARY) $(DESTDIR)$(BINDIR)
|
|
|
|
|
2016-02-28 10:46:24 -05:00
|
|
|
%: %.c
|
|
|
|
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $< -o $@
|
2014-04-21 16:37:44 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(BINARY) *.o
|