25 lines
464 B
Makefile
25 lines
464 B
Makefile
CFLAGS ?= -Wall -Wextra -g -O1
|
|
LDFLAGS ?= -g -O1
|
|
LIB_CFLAGS ?= -fpic
|
|
LIB_LDFLAGS ?= -shared
|
|
ORDINARY_OBJS := build idx inspect maint
|
|
|
|
.PHONY: all ordinary init clean
|
|
|
|
all: ordinary
|
|
|
|
ordinary: bin/libordinary.so
|
|
|
|
init: bin
|
|
|
|
bin:
|
|
mkdir -p -- bin
|
|
|
|
bin/libordinary.so: $(addprefix bin/,$(addsuffix .o,$(ORDINARY_OBJS)))
|
|
cc $(LDFLAGS) $(LIB_LDFLAGS) -o $@ $^
|
|
|
|
bin/%.o: src/%.c | init
|
|
cc $(CFLAGS) $(LIB_CFLAGS) -std=c99 -I include -c -o $@ $<
|
|
|
|
clean:
|
|
rm -rf -- bin
|