summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-04-15 18:22:14 +0200
committerAnton Khirnov <anton@khirnov.net>2019-04-15 18:32:52 +0200
commit34917b834143c180562fec66a53d1180251a4b7d (patch)
treee745ada4b544874302cbf816a744af255d44dc21 /Makefile
Initial commit.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3bdcbef
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+TARGET = membw
+
+CFLAGS = -std=c99 -D_XOPEN_SOURCE=700 -fPIC -g -I. -O3
+TARGET_LDFLAGS = -lm
+CC = cc
+
+OBJS = \
+ membw.o \
+ readwrite.o \
+
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(CC) ${TARGET_LDFLAGS} -o $@ $(OBJS)
+
+%.o: %.c
+ $(CC) $(CFLAGS) -MMD -MF $(@:.o=.d) -MT $@ -c -o $@ $<
+
+%.o: %.asm
+ nasm -f elf64 -M $< > $(@:.o=.d)
+ nasm -f elf64 -o $@ $<
+
+clean:
+ -rm -f *.o *.d $(TARGET)
+
+-include $(OBJS:.o=.d)
+
+.PHONY: clean