aboutsummaryrefslogtreecommitdiffstats
path: root/test/makefile
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-06-26 10:31:10 +0000
committerbloodstalker <thabogre@gmail.com>2018-06-26 10:31:10 +0000
commit4a471ef1b289300032c2a5f40d0fd290bf33e906 (patch)
tree46eece53122e4dc00fed118cfb60129a233eb7a1 /test/makefile
parentInitial commit (diff)
downloaddelf-4a471ef1b289300032c2a5f40d0fd290bf33e906.tar.gz
delf-4a471ef1b289300032c2a5f40d0fd290bf33e906.zip
first commit
Diffstat (limited to '')
-rw-r--r--test/makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/makefile b/test/makefile
new file mode 100644
index 0000000..9414f84
--- /dev/null
+++ b/test/makefile
@@ -0,0 +1,35 @@
+
+##################################VARS#################################
+CC?=gcc
+CC=gcc
+CC_FLAGS=-fpic -O0 -g -v --debug
+#LD_FLAGS= -l bfd
+LD_FLAGS=
+TARGET=test
+##################################RULES################################
+.DEFAULT:all
+
+.PHONY:all clean help
+
+all:$(TARGET) $(TARGET).so $(TARGET).asm
+
+.c.o:
+ $(CC) $(CC_FLAGS) -c $< -o $@
+
+$(TARGET): $(TARGET).o
+ $(CC) $^ $(LD_FLAGS) -o $@
+
+$(TARGET).asm: $(TARGET).o
+ objdump -r -d -M intel -S $(TARGET).o > $(TARGET).asm
+
+$(TARGET).so: $(TARGET).o
+ $(CC) $^ $(LD_FLAGS) -shared -o $@
+
+clean:
+ rm -f *.o *~ $(TARGET) $(TARGET).so $(TARGET).asm
+
+help:
+ @echo 'all builds so and exe. all is the default.'
+ @echo 'clean runs clean.'
+ @echo 'help runs help.'
+