Added make file
This commit is contained in:
parent
5f8bee0592
commit
445b6dcf26
27
Makefile
Normal file
27
Makefile
Normal file
@ -0,0 +1,27 @@
|
||||
# Compiler settings
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -O2
|
||||
PREFIX = /usr/local
|
||||
|
||||
# Files
|
||||
PROG = shardz
|
||||
SOURCES = shardz.c
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
|
||||
# Targets
|
||||
all: $(PROG)
|
||||
|
||||
$(PROG): $(OBJECTS)
|
||||
$(CC) $(OBJECTS) $(CFLAGS) -o $(PROG)
|
||||
|
||||
install: $(PROG)
|
||||
install -d $(DESTDIR)$(PREFIX)/bin
|
||||
install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG)
|
||||
|
||||
clean:
|
||||
rm -f $(PROG) $(OBJECTS)
|
||||
|
||||
.PHONY: all install uninstall clean
|
16
README.md
16
README.md
@ -11,11 +11,25 @@ Shardz is a lightweight C utility that shards *(splits)* the output of any proce
|
||||
- Load balancing input streams
|
||||
- Splitting any line-based input for distributed processing
|
||||
|
||||
## Building
|
||||
## Building & Installation
|
||||
|
||||
### Quick Build
|
||||
```bash
|
||||
gcc -o shardz shardz.c
|
||||
```
|
||||
|
||||
### Using Make
|
||||
```bash
|
||||
# Build only
|
||||
make
|
||||
|
||||
# Build and install system-wide (requires root/sudo)
|
||||
sudo make install
|
||||
|
||||
# To uninstall
|
||||
sudo make uninstall
|
||||
```
|
||||
|
||||
## Usage
|
||||
```bash
|
||||
some_command | shardz INDEX/TOTAL
|
||||
|
Loading…
Reference in New Issue
Block a user