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)
--- /dev/null
+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)