diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..28e8e07 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +CC = gcc + +INCFLAGS = -Isrc + +CCFLAGS = -std=gnu99 -Wall -Wextra -pedantic -O2 +CCFLAGS += $(INCFLAGS) + +LDFLAGS += $(INCFLAGS) + +BIN = bin +APP = $(BIN)/app +SRC = $(shell find src -name "*.c") +OBJ = $(SRC:%.c=$(BIN)/%.o) + +.PHONY: dirs run clean build install uninstall + +EOF: clean build + +dirs: + mkdir -p ./$(BIN) + mkdir -p ./$(BIN)/src + mkdir -p ./$(BIN)/src/commands + +run: build + $(APP) + +build: dirs ${OBJ} + ${CC} -o $(APP) $(filter %.o,$^) $(LDFLAGS) + +$(BIN)/%.o: %.c + $(CC) -o $@ -c $< $(CCFLAGS) + +clean: + rm -rf $(APP) + rm -rf $(BIN) + +install: + cp $(APP) /usr/local/bin/lazysphere + +uninstall: + rm /usr/local/bin/lazysphere |