about summary refs log tree commit diff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/aflpp_driver/GNUmakefile27
-rw-r--r--examples/aflpp_driver/Makefile26
2 files changed, 29 insertions, 24 deletions
diff --git a/examples/aflpp_driver/GNUmakefile b/examples/aflpp_driver/GNUmakefile
new file mode 100644
index 00000000..fca3fd2c
--- /dev/null
+++ b/examples/aflpp_driver/GNUmakefile
@@ -0,0 +1,27 @@
+ifeq "" "$(LLVM_CONFIG)"
+  LLVM_CONFIG=llvm-config
+endif
+
+LLVM_BINDIR = $(shell $(LLVM_CONFIG) --bindir 2>/dev/null)
+ifneq "" "$(LLVM_BINDIR)"
+  LLVM_BINDIR := $(LLVM_BINDIR)/
+endif
+
+FLAGS=-O3 -funroll-loops
+
+all:	libAFLDriver.a libAFLDriver2.a
+
+aflpp_driver.o:	aflpp_driver.cpp
+	$(LLVM_BINDIR)clang++ $(FLAGS) -stdlib=libc++ -funroll-loops -std=c++11 -c aflpp_driver.cpp
+
+afl-llvm-rt.o:	../../llvm_mode/afl-llvm-rt.o.c
+	$(LLVM_BINDIR)clang $(FLAGS) -I../../include -c -o afl-llvm-rt.o ../../llvm_mode/afl-llvm-rt.o.c
+
+libAFLDriver.a:	aflpp_driver.o
+	ar ru libAFLDriver.a aflpp_driver.o
+
+libAFLDriver2.a:	aflpp_driver.o afl-llvm-rt.o
+	ar ru libAFLDriver2.a aflpp_driver.o afl-llvm-rt.o
+
+clean:
+	rm -f *.o libAFLDriver*.a *~ core
diff --git a/examples/aflpp_driver/Makefile b/examples/aflpp_driver/Makefile
index 6f7c7bc9..3666a74d 100644
--- a/examples/aflpp_driver/Makefile
+++ b/examples/aflpp_driver/Makefile
@@ -1,24 +1,2 @@
-ifeq "" "$(LLVM_CONFIG)"
-  LLVM_CONFIG=llvm-config
-endif
-
-LLVM_BINDIR = $(shell $(LLVM_CONFIG) --bindir 2>/dev/null)
-ifneq "" "$(LLVM_BINDIR)"
-  LLVM_BINDIR := $(LLVM_BINDIR)/
-endif
-
-
-
-all:	libAFLDriver.a
-
-aflpp_driver.o:	aflpp_driver.cpp
-	$(LLVM_BINDIR)clang++ -O3 -march=native -stdlib=libc++ -funroll-loops -std=c++11 -c aflpp_driver.cpp
-
-afl-llvm-rt.o:	../../llvm_mode/afl-llvm-rt.o.c
-	$(LLVM_BINDIR)clang++ -O3 -march=native -funroll-loops -stdlib=libc++ -std=c++11 -c aflpp_driver.cpp
-
-libAFLDriver.a:	aflpp_driver.o afl-llvm-rt.o
-	ar ru libAFLDriver.a aflpp_driver.o
-
-clean:
-	rm -f *.o libAFLDriver.a *~ core
+all:
+	@gmake all || echo please install GNUmake