You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
542 B
33 lines
542 B
CC ?= gcc
|
|
target ?= $(shell ${CC} -dumpmachine)
|
|
CC_FLAGS ?=
|
|
CC_FLAGS := ${CC_FLAGS} -Ilib
|
|
DESTDIR ?= /
|
|
|
|
ifndef NO_GC
|
|
CC_FLAGS := ${CC_FLAGS} -lgc -DNO_GC=1
|
|
endif
|
|
|
|
.PHONY: all debug clean build-release install
|
|
all:
|
|
@$(shell mkdir -p bin)
|
|
all: main
|
|
|
|
main:
|
|
@${CC} -o bin/httpsrv src/main.c ${CC_FLAGS}
|
|
|
|
debug: CC_FLAGS:=-g -O0 -v ${CC_FLAGS}
|
|
debug: all
|
|
|
|
clean:
|
|
@rm -rf bin
|
|
|
|
release: CC_FLAGS:=-O3 ${CC_FLAGS}
|
|
release: all
|
|
release:
|
|
@strip bin/*
|
|
tar -czf release.tar.gz bin/*
|
|
|
|
install:
|
|
@install -m 777 bin/httpsrv ${DESTDIR}/usr/local/bin
|