Files
smol/Makefile
T
2025-04-15 11:41:00 +07:00

42 lines
1.1 KiB
Makefile

CC=gcc
STRIP=strip
BIN=build
SRC=src
PREFIX=/usr
CFLAGS=-Wall
default: all
all: clean build
build: smol smol-pthreads smol-http smol-http-pthreads
smol:
$(CC) -o $(BIN)/smol $(SRC)/smol.c -lcrypto -lssl $(CFLAGS)
smol-pthreads:
$(CC) -o $(BIN)/smol-pthreads $(SRC)/smol-pthreads.c -lcrypto -lssl $(CFLAGS)
smol-http:
$(CC) -o $(BIN)/smol-http $(SRC)/smol-http.c $(CFLAGS)
smol-http-pthreads:
$(CC) -o $(BIN)/smol-http-pthreads $(SRC)/smol-http-pthreads.c $(CFLAGS)
clean:
if [ -d $(BIN) ]; then rm -rv $(BIN);mkdir -pv $(BIN);else mkdir -pv $(BIN);fi
install:
cp -v $(BIN)/* $(PREFIX)/bin/
$(STRIP) $(PREFIX)/bin/smol
$(STRIP) $(PREFIX)/bin/smol-pthreads
$(STRIP) $(PREFIX)/bin/smol-http
$(STRIP) $(PREFIX)/bin/smol-http-pthreads
uninstall: remove
remove:
if [ -f $(PREFIX)/bin/smol ];then rm -v $(PREFIX)/bin/smol;fi
if [ -f $(PREFIX)/bin/smol-pthreads ];then rm -v $(PREFIX)/bin/smol-pthreads;fi
if [ -f $(PREFIX)/bin/smol-http ];then rm -v $(PREFIX)/bin/smol-http;fi
if [ -f $(PREFIX)/bin/smol-http-pthreads ];then rm -v $(PREFIX)/bin/smol-http-pthreads;fi