urbit/pkg/ent/Makefile
Benjamin Summers 9618f37965 Add 'pkg/ent/' from commit '31ac2913f14c6f7631f5792ad942605fb2d9fb87'
git-subtree-dir: pkg/ent
git-subtree-mainline: 1207c204cb
git-subtree-split: 31ac2913f1
2019-03-04 16:49:14 -08:00

30 lines
575 B
Makefile

CC ?= cc
AR ?= ar
PREFIX ?= ./out
ifndef IMPL
$(error IMPL must be set)
endif
################################################################################
.PHONY: all test install clean
all: ent.c ent.h
$(CC) -D$(IMPL) -O3 -Wall -Werror -pedantic -std=gnu99 -c ent.c
$(AR) rcs libent.a ent.o
test: all
$(CC) -D$(IMPL) -O3 -Wall -Werror -pedantic -std=gnu99 ent.c test.c -o test
./test
install: all
@mkdir -p $(PREFIX)/lib/
@mkdir -p $(PREFIX)/include/
cp libent.a $(PREFIX)/lib/
cp ent.h $(PREFIX)/include/
clean:
rm -f *.o *.a test
rm -rf ./out