]> Zhao Yanbai Git Server - minix.git/commitdiff
LLVM passes: centralize Makefile structure 40/3140/1
authorDavid van Moolenbroek <david@minix3.org>
Mon, 31 Aug 2015 14:46:42 +0000 (16:46 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Thu, 17 Sep 2015 13:56:41 +0000 (13:56 +0000)
Make the passes we have so far, hello and WeakAliasModuleOverride,
use settings from a Makefile include file in the parent directory.
This change is in preparation of adding other passes.

Change-Id: Ib195ee7f5c7626f4975368b02c944382e87e3814

minix/llvm/passes/Makefile.inc
minix/llvm/passes/WeakAliasModuleOverride/Makefile
minix/llvm/passes/hello/Makefile

index 06ff2c53589c9c787859b8942387c6bdcbfd345b..7661894ff9743264d22eb4474ca5b8983a1ae6db 100644 (file)
@@ -4,3 +4,36 @@
 # This files is used with gmake, so do NOT add .include "..."
 #
 LLVMPREFIX?=../../../../../obj_llvm.i386/Release+Asserts
+
+CFLAGS += -D__MINIX -D_MINIX_SYSTEM
+INCLUDES += -I../../include
+
+QUIET=@
+ECHO=echo
+CP=cp
+
+PASSLIBNAME = $(PASSNAME).so
+
+LLVM_VERSION=$(shell ($(LLVMPREFIX)/bin/llvm-config --version | sed "s/[^0-9]//g"))
+CFLAGS  += -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -DHAVE_EXCEPTIONS=0
+CFLAGS  += $(shell $(LLVMPREFIX)/bin/llvm-config --cxxflags) -g -DLLVM_VERSION=$(LLVM_VERSION)
+LDFLAGS += $(shell $(LLVMPREFIX)/bin/llvm-config --ldflags)
+
+INCLUDES += -I../include
+
+all: $(PASSLIBNAME)
+
+$(PASSLIBNAME): $(OBJS)
+       $(QUIET) $(ECHO) "  [LINK] $@"
+       $(QUIET) $(CXX) $(CFLAGS) -shared -o $@ $(CPPS) $(OBJS) $(LDFLAGS) $(LIBS)
+
+%.o: %.cpp $(HEADERS)
+       $(QUIET) $(ECHO)  "  [C++] $<"
+       $(QUIET) $(CXX) $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+install: $(PASSLIBNAME)
+       $(QUIET) -mkdir -p ../../bin
+       $(QUIET) $(CP) $(PASSLIBNAME) ../../bin/$(PASSLIBNAME)
+
+clean:
+       -rm -f $(OBJS) $(PASSLIBNAME)
index 7de1b80856fe3ffe2cbb0e7f474c4d622842d3c4..6f6e30d4236b1dc3b08b149b9fd1d27fad033464 100644 (file)
@@ -1,28 +1,7 @@
-include ../Makefile.inc
-
-QUIET=@
-ECHO=echo
-CP=cp
 
-PASSLIBNAME:= weak-alias-module-override.so
+PASSNAME:= weak-alias-module-override
 
-LLVM_VERSION = $($LLVMPREFIX/bin/llvm-config --version | sed "s/[^0-9]//g")
-CFLAGS  += -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -DHAVE_EXCEPTIONS=0
-CFLAGS  += $(shell $(LLVMPREFIX)/bin/llvm-config --cxxflags) -g -DLLVM_VERSION=$(LLVM_VERSION)
-LDFLAGS += $(shell $(LLVMPREFIX)/bin/llvm-config --ldflags)
 OBJS= WeakAliasModuleOverride.o
+HEADERS=
 
-$(PASSLIBNAME): $(OBJS)
-       $(QUIET) $(ECHO) "  [LINK] $@"
-       $(QUIET) $(CXX) $(CFLAGS) -shared -o $@ $(CPPS) $(OBJS) $(LDFLAGS) $(LIBS)
-
-%.o: %.cpp $(HEADERS)
-       $(QUIET) $(ECHO)  "  [C++] $<"
-       $(QUIET) $(CXX) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-
-install: $(PASSLIBNAME)
-       $(QUIET) -mkdir -p ../../bin
-       $(QUIET) $(CP)  $(PASSLIBNAME) ../../bin/$(PASSLIBNAME)
-
-clean:
-       -rm -f *.o *.so
+include ../Makefile.inc
index ca848156da2ffc363868239f5e507163baa12919..4853bbf0f8b583efec545477377d7f64f35df3a7 100644 (file)
@@ -1,28 +1,7 @@
-include ../Makefile.inc
-
-QUIET=@
-ECHO=echo
-CP=cp
 
-PASSLIBNAME:= hello.so
+PASSNAME:= hello
 
-LLVM_VERSION=$(shell ($(LLVMPREFIX)/bin/llvm-config --version | sed "s/[^0-9]//g"))
-CFLAGS  += -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -DHAVE_EXCEPTIONS=0
-CFLAGS  += $(shell $(LLVMPREFIX)/bin/llvm-config --cxxflags) -g -DLLVM_VERSION=$(LLVM_VERSION)
-LDFLAGS += $(shell $(LLVMPREFIX)/bin/llvm-config --ldflags)
 OBJS= hello.o
+HEADERS=
 
-$(PASSLIBNAME): $(OBJS)
-       $(QUIET) $(ECHO) "  [LINK] $@"
-       $(QUIET) $(CXX) $(CFLAGS) -shared -o $@ $(CPPS) $(OBJS) $(LDFLAGS) $(LIBS)
-
-%.o: %.cpp $(HEADERS)
-       $(QUIET) $(ECHO)  "  [C++] $<"
-       $(QUIET) $(CXX) $(CFLAGS) -c -o $@ $<
-
-install: $(PASSLIBNAME)
-       $(QUIET) -mkdir -p ../../bin
-       $(QUIET) $(CP)  $(PASSLIBNAME) ../../bin/$(PASSLIBNAME)
-
-clean:
-       -rm -f *.o *.so
+include ../Makefile.inc