CFLAGS = -Wall -Werror -Wshadow -g -O$(O) CC = gcc O = 3 targets = 2bmp pttrc #targets = com6502sv decom6502sv com6502act combochs32 6502act-getdict bochs32act-getdict comhuff6502sv LIBBMPTAR=libbmp-0.1.3.tar.bz2 LIBBMPURL=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libbmp/$(LIBBMPTAR) all: $(targets) .PHONY: all clean $(LIBBMPTAR): wget $(LIBBMPURL) libbmp/configure: $(LIBBMPTAR) tar -jxf $(LIBBMPTAR) ln -s libbmp-0.1.3 libbmp touch libbmp/configure opt/lib/libbmp.a: libbmp/configure cd libbmp && ./configure --prefix=$(PWD)/opt cd libbmp && make install 2bmp: opt/lib/libbmp.a 2bmp.c $(CC) $(CFLAGS) -Iopt/include -D __UI_STAND_ALONE__ 2bmp.c opt/lib/libbmp.a -o 2bmp -lm 2bmp.o: opt/lib/libbmp.h $(CC) $(CFLAGS) -Iopt/include 2bmp.c -c uthash/include/uthash.h: git clone https://github.com/troydhanson/uthash.git pttrc: pttrc.c uthash/include/uthash.h $(CC) $(CFLAGS) pttrc.c -I uthash/include -o pttrc -lm compress: comp.c bitxor.o $(CC) -I uthash/include $(CFLAGS) -mmmx $< bitxor.o -o $@ bitxor.o: bitxor.c bitxor.h $(CC) $(CFLAGS) -mmmx $< -c clean: -rm -rf *~ *.o $(targets)