UNIX makefile for imago
authorJohn Tsiombikas <nuclear@mutantstargoat.com>
Tue, 30 Aug 2016 21:29:26 +0000 (00:29 +0300)
committerJohn Tsiombikas <nuclear@mutantstargoat.com>
Tue, 30 Aug 2016 21:29:26 +0000 (00:29 +0300)
.gitignore
GNUmakefile
libs/imago/GNUmakefile [new file with mode: 0644]

index 201c530..05be71c 100644 (file)
@@ -13,3 +13,6 @@ Release
 *.suo
 *sdf
 demo
+*.zip
+data
+*.a
index 312fd6a..972046b 100644 (file)
@@ -2,14 +2,18 @@ src = $(wildcard src/*.c) $(wildcard src/sdl/*.c)
 obj = $(src:.c=.o)
 bin = demo
 
-inc = -Isrc -Isrc/sdl
+inc = -Isrc -Isrc/sdl -Ilibs/imago/src
 
 CFLAGS = -pedantic -Wall -g $(inc) `sdl-config --cflags`
-LDFLAGS = `sdl-config --libs` -lm
+LDFLAGS = -Llibs/imago -limago `sdl-config --libs` -lm
 
-$(bin): $(obj)
+$(bin): $(obj) imago
        $(CC) -o $@ $(obj) $(LDFLAGS)
 
+.PHONY: imago
+imago:
+       $(MAKE) -C libs/imago
+
 .PHONY: clean
 clean:
        rm -f $(obj) $(bin)
diff --git a/libs/imago/GNUmakefile b/libs/imago/GNUmakefile
new file mode 100644 (file)
index 0000000..beba77c
--- /dev/null
@@ -0,0 +1,15 @@
+src = $(wildcard src/*.c) \
+         $(wildcard zlib/*.c) \
+         $(wildcard libpng/*.c) \
+         $(wildcard jpeglib/*.c)
+obj = $(src:.c=.o)
+alib = libimago.a
+
+CFLAGS = -pedantic -Wall -Wno-main -g -Izlib -Ilibpng -Ijpeglib
+
+$(alib): $(obj)
+       $(AR) rcs $@ $(obj)
+
+.PHONY: clean
+clean:
+       rm -f $(obj) $(bin)