mirror of
https://github.com/urbit/shrub.git
synced 2024-11-24 13:06:09 +03:00
9618f37965
git-subtree-dir: pkg/ent git-subtree-mainline:1207c204cb
git-subtree-split:31ac2913f1
30 lines
575 B
Makefile
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
|