diff options
author | c+1 | 2023-05-30 08:16:31 -0400 |
---|---|---|
committer | c+1 | 2023-05-30 08:16:31 -0400 |
commit | 8b008c1c2773ac80df36f7a49dcb9c2c451cd258 (patch) | |
tree | 502c30edb699564f620d57c17e41e34e4a88ae3d | |
parent | 81406518603f07f65d51c694e56143edc05d7df5 (diff) |
fixed makefile
-rw-r--r-- | Makefile | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -1,20 +1,26 @@ -exec = halk.out -sources := $(wildcard src/*.c) -objects = $(sources:.c=.o) -sources := $(filter-out src/parser.c, $(sources)) # exclude the incomplete parser for now. -flags = -g +binname := halk +exec := $(binname).out + +compiler := clang +flags := -g + +sources := $(wildcard src/*.c) +sources := $(filter-out src/parser.c, $(sources)) # exclude the incomplete parser for now. +objects := $(sources:.c=.o) + $(exec): $(objects) - clang $(objects) $(flags) -o $(exec) + $(compiler) $(objects) $(flags) -o $(exec) %.o: %.c include/%.h - clang -c $(flags) $< -o $@ + $(compiler) -c $(flags) $< -o $@ install: make - cp ./halk.out /usr/local/bin/halk + cp ./$(exec) /usr/local/bin/$(binname) + +uninstall: + rm -f /usr/local/bin/$(binname) clean: - -rm *.out - -rm *.o - -rm src/*.o + rm -f *.out *.o src/*.o |