about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gcc_plugin/Makefile2
-rw-r--r--libdislocator/Makefile2
-rw-r--r--src/third_party/libradamsa/GNUmakefile (renamed from src/third_party/libradamsa/Makefile)0
-rw-r--r--unicorn_mode/samples/c/GNUmakefile42
-rw-r--r--unicorn_mode/samples/c/Makefile49
-rw-r--r--unicorn_mode/samples/persistent/Makefile8
6 files changed, 53 insertions, 50 deletions
diff --git a/gcc_plugin/Makefile b/gcc_plugin/Makefile
index 1c6f365f..3b507c6b 100644
--- a/gcc_plugin/Makefile
+++ b/gcc_plugin/Makefile
@@ -36,7 +36,7 @@ CFLAGS = -Wall -I../include -Wno-pointer-sign \
                -Wno-unused-function
 
 CXXFLAGS    ?= -O3 -g -funroll-loops -D_FORTIFY_SOURCE=2
-CXXEFLAGS   := $(CXXFLAGS) -Wall
+CXXEFLAGS   = $(CXXFLAGS) -Wall
 
 CC          ?= gcc
 CXX         ?= g++
diff --git a/libdislocator/Makefile b/libdislocator/Makefile
index 201f1e92..37fd4fd6 100644
--- a/libdislocator/Makefile
+++ b/libdislocator/Makefile
@@ -28,7 +28,7 @@ all: libdislocator.so
 
 VPATH = ..
 libdislocator.so: libdislocator.so.c ../config.h
-	$(CC) $(CFLAGS) -shared -fPIC $< -o ../$@ $(LDFLAGS)
+	$(CC) $(CFLAGS) -shared -fPIC libdislocator.so.c -o ../$@ $(LDFLAGS)
 
 .NOTPARALLEL: clean
 
diff --git a/src/third_party/libradamsa/Makefile b/src/third_party/libradamsa/GNUmakefile
index c5a78ead..c5a78ead 100644
--- a/src/third_party/libradamsa/Makefile
+++ b/src/third_party/libradamsa/GNUmakefile
diff --git a/unicorn_mode/samples/c/GNUmakefile b/unicorn_mode/samples/c/GNUmakefile
deleted file mode 100644
index fe100490..00000000
--- a/unicorn_mode/samples/c/GNUmakefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# UnicornAFL Usage
-# Original Unicorn Example Makefile by Nguyen Anh Quynh <aquynh@gmail.com>, 2015
-# Adapted for AFL++ by domenukk <domenukk@gmail.com>, 2020
-
-UNAME_S := $(shell uname -s)
-
-LIBDIR = ../../unicornafl
-BIN_EXT =
-AR_EXT = a
-
-# Verbose output?
-V ?= 0
-
-CFLAGS += -Wall -Werror -I../../unicornafl/include
-
-LDFLAGS += -L$(LIBDIR) -lpthread -lm
-ifeq ($(UNAME_S), Linux)
-LDFLAGS += -lrt
-endif
-
-ifneq ($(CROSS),)
-CC = $(CROSS)gcc
-endif
-
-.PHONY: all clean
-
-all: harness
-
-clean:		
-	rm -rf *.o harness harness-debug
-
-harness.o: harness.c ../../unicornafl/include/unicorn/*.h
-	${CC} ${CFLAGS} -O3 -c $<
-
-harness-debug.o: harness.c ../../unicornafl/include/unicorn/*.h
-	${CC} ${CFLAGS} -g -c $< -o $@
-
-harness: harness.o
-	${CC} -L${LIBDIR} $< ../../unicornafl/libunicornafl.a $(LDFLAGS) -o $@
-
-debug: harness-debug.o
-	${CC} -L${LIBDIR} $< ../../unicornafl/libunicornafl.a $(LDFLAGS) -o harness-debug
diff --git a/unicorn_mode/samples/c/Makefile b/unicorn_mode/samples/c/Makefile
index 0b306dde..cb491e10 100644
--- a/unicorn_mode/samples/c/Makefile
+++ b/unicorn_mode/samples/c/Makefile
@@ -1,2 +1,47 @@
-all:
-	@echo please use GNU make, thanks!
+# UnicornAFL Usage
+# Original Unicorn Example Makefile by Nguyen Anh Quynh <aquynh@gmail.com>, 2015
+# Adapted for AFL++ by domenukk <domenukk@gmail.com>, 2020
+.POSIX:
+UNAME_S =$(shell uname -s)# GNU make
+UNAME_S:sh=uname -s       # BSD make
+_UNIQ=_QINU_
+
+LIBDIR = ../../unicornafl
+BIN_EXT =
+AR_EXT = a
+
+# Verbose output?
+V ?= 0
+
+CFLAGS += -Wall -Werror -I../../unicornafl/include
+
+LDFLAGS += -L$(LIBDIR) -lpthread -lm
+
+_LRT = $(_UNIQ)$(UNAME_S:Linux=)
+__LRT = $(_LRT:$(_UNIQ)=-lrt)
+LRT = $(__LRT:$(_UNIQ)=)
+
+LDFLAGS += $(LRT)
+
+_CC = $(_UNIQ)$(CROSS)
+__CC = $(_CC:$(_UNIQ)=$(CC))
+MYCC = $(__CC:$(_UNIQ)$(CROSS)=$(CROSS)gcc)
+
+.PHONY: all clean
+
+all: harness
+
+clean:
+	rm -rf *.o harness harness-debug
+
+harness.o: harness.c ../../unicornafl/include/unicorn/*.h
+	${MYCC} ${CFLAGS} -O3 -c harness.c
+
+harness-debug.o: harness.c ../../unicornafl/include/unicorn/*.h
+	${MYCC} ${CFLAGS} -g -c harness.c -o $@
+
+harness: harness.o
+	${MYCC} -L${LIBDIR} harness.o ../../unicornafl/libunicornafl.a $(LDFLAGS) -o $@
+
+debug: harness-debug.o
+	${MYCC} -L${LIBDIR} harness.o ../../unicornafl/libunicornafl.a $(LDFLAGS) -o harness-debug
diff --git a/unicorn_mode/samples/persistent/Makefile b/unicorn_mode/samples/persistent/Makefile
index 96aedacb..cb491e10 100644
--- a/unicorn_mode/samples/persistent/Makefile
+++ b/unicorn_mode/samples/persistent/Makefile
@@ -35,13 +35,13 @@ clean:
 	rm -rf *.o harness harness-debug
 
 harness.o: harness.c ../../unicornafl/include/unicorn/*.h
-	${MYCC} ${CFLAGS} -O3 -c $<
+	${MYCC} ${CFLAGS} -O3 -c harness.c
 
 harness-debug.o: harness.c ../../unicornafl/include/unicorn/*.h
-	${MYCC} ${CFLAGS} -g -c $< -o $@
+	${MYCC} ${CFLAGS} -g -c harness.c -o $@
 
 harness: harness.o
-	${MYCC} -L${LIBDIR} $< ../../unicornafl/libunicornafl.a $(LDFLAGS) -o $@
+	${MYCC} -L${LIBDIR} harness.o ../../unicornafl/libunicornafl.a $(LDFLAGS) -o $@
 
 debug: harness-debug.o
-	${MYCC} -L${LIBDIR} $< ../../unicornafl/libunicornafl.a $(LDFLAGS) -o harness-debug
+	${MYCC} -L${LIBDIR} harness.o ../../unicornafl/libunicornafl.a $(LDFLAGS) -o harness-debug