diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8509a27 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +CC = gcc +CFLAGS = -Wall -Wextra -O2 -pipe +TARGET = build/mikusays +SRC = $(wildcard src/*.c) +OBJ = $(SRC:%.c=obj/%.o) +PREFIX = /usr/local + +$(TARGET): $(OBJ) + @mkdir -p $(@D) + $(CC) $(CFLAGS) -o $(TARGET) $(OBJ) $(LDLIBS) + +install: $(TARGET) + mkdir -p $(DESTDIR)$(PREFIX)/bin + install -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(notdir $(TARGET)) + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(notdir $(TARGET)) + +obj/%.o: %.c + @mkdir -p $(@D) + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(TARGET) $(OBJ) + +run: + make + build/mikusaysc "this is a test" |
