-CFLAGS += -Wall -Wwrite-strings -Wpointer-arith -Wmissing-prototypes \
- -Wstrict-prototypes -Werror -g
+CC= gcc
+OPTIMISE= -O2
+WERROR= -Werror
+WARNINGS= -Wall -Wwrite-strings -Wpointer-arith -Wmissing-prototypes \
+ -Wstrict-prototypes -Wno-format-zero-length
+DEBUG=-g
-all: convert x-manip-window
+CFLAGS += $(WARNINGS) $(WERROR) $(OPTIMISE) $(DEBUG)
+
+TARGETS= ypp-commodities
+
+all: $(TARGETS)
CONVERT_OBJS= convert.o ocr.o pages.o structure.o
-convert: $(CONVERT_OBJS) -lnetpbm -lXtst -lX11
-$(CONVERT_OBJS): ocr.h convert.h structure.h
+ypp-commodities: $(CONVERT_OBJS) -lnetpbm -lXtst -lX11
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+
+$(CONVERT_OBJS): ocr.h convert.h structure.h common.h
-x-manip-window: -lXtst -lX11
+clean:
+ rm -f $(TARGETS) *.o core core.* *~ t t.* u u.* ./#pages#.ppm