From 8b008c1c2773ac80df36f7a49dcb9c2c451cd258 Mon Sep 17 00:00:00 2001 From: c+1 Date: Tue, 30 May 2023 08:16:31 -0400 Subject: fixed makefile --- Makefile | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b6866bc..42b6fdb 100644 --- a/Makefile +++ b/Makefile @@ -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 -- cgit v1.2.3