Added C header and printing demo.
[libmalice.git] / Makefile
index cdd89df8203d6d86d144266e1935de001ec73b8f..8cdac422c0c3f56578eff0c226d7c44d8562b1d5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,26 @@
 NASMFLAGS = -f elf
+CINCLUDE=
+CWARNS=-Wall -Wpointer-arith -Wnested-externs
+CFLAGS=$(CINCLUDE) $(CWARNS) -O2
+LDFLAGS=
 
-all: libmalice.o
+SRCDIR=src
+BINDIR=build
+
+all: libmalice.o demo-printing
 
 libmalice.o: libmalice.asm
        nasm $(NASMFLAGS) -o $@ $<
 
+.c.o:
+       cc $(CFLAGS) -c -o $@ $<
+
+demo-printing: demo-printing.o libmalice.o
+       ld $(LDFLAGS) -nostdlib -e _lmStart -o demo-printing demo-printing.o libmalice.o
+
+demos: demo-printing
+
 .PHONY : clean
 clean:
        rm -f *.o
-
-.PHONY : distclean
-distclean: clean
-       rm -f *~
-
-.PHONY : test
-test: all
+       rm -f demo-printing