From 9e87372371794bc3e7d46698141966c00acaad0e Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Sat, 11 Jan 2020 19:46:15 +0000 Subject: Tidying up - Removed unused example files - Removed redundant common.c - Added extra files to make sure the current version compiles the nqueens solution correctly - Added extensionless files to .gitignore - Added a way to install sinter --- Makefile | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 896dbcc..e25ffd0 100644 --- a/Makefile +++ b/Makefile @@ -3,24 +3,33 @@ CXX = clang++ YACC = bison LEX = flex -DEBUG = -ggdb3 -O0 -DGC_DEBUG +INSTALL = install -c + +DEBUG = -ggdb3 -DGC_DEBUG RELEASE = -O2 -DNDEBUG -CFLAGS = --std=c99 -Wpedantic -Wall -Wextra -Werror $(DEBUG) +CFLAGS = --std=c99 -Wpedantic -Wall -Wextra -Werror $(RELEASE) LFLAGS = -D_POSIX_C_SOURCE=200809L LLVM_MODULES = core executionengine mcjit interpreter analysis native bitwriter -CFLAGS += $(shell llvm-config --cflags) -I$(HOME)/usr/include +CFLAGS += $(shell llvm-config --cflags) CXXFLAGS += $(shell llvm-config --cppflags) -LDFLAGS += $(shell llvm-config --ldflags) -L$(HOME)/usr/lib -LDLIBS += $(shell llvm-config --libs $(LLVM_MODULES) --system-libs) -lgc +LDFLAGS += $(shell llvm-config --ldflags) +LDLIBS += $(shell llvm-config --libs $(LLVM_MODULES) --system-libs) -.PHONY: default all clean test +.PHONY: default all clean test install uninstall default: all -all: sinter common.o +all: sinter + +install: all + $(INSTALL) -d $(PREFIX)/bin/ + $(INSTALL) sinter $(PREFIX)/bin/ + +uninstall: + $(RM) $(PREFIX)/bin/sinter sinter.o: sinter.h parse.h debug.h error.h scope.h llvm_codegen.h \ graphviz_codegen.h -- cgit v1.2.1