Commit 526f2c55 authored by FRIGN's avatar FRIGN

Overhaul buildsystem

parent d5f6f70d
......@@ -4,44 +4,24 @@
include config.mk
SRC = png2ff.c ff2png.c
OBJ = ${SRC:.c=.o}
all: options png2ff ff2png
all: png2ff ff2png
options:
@echo farbfeld build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
.c.o:
.c:
@echo CC $<
@${CC} -c -o $@ ${CFLAGS} $<
${OBJ}: config.mk
png2ff: png2ff.o
@echo CC -o $@
@${CC} -o $@ png2ff.o ${PNG_LIBS} ${LDFLAGS}
ff2png: ff2png.o
@echo CC -o $@
@${CC} -o $@ ff2png.o ${PNG_LIBS} ${LDFLAGS}
@${CC} -o $@ ${CFLAGS} ${LIBS} ${LDFLAGS} $<
clean:
@echo cleaning
@rm -f png2ff ff2png ${OBJ}
rm -f png2ff ff2png
install: all
@echo installing executable files to ${DESTDIR}${PREFIX}/bin
install:
@echo installing into ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f png2ff ff2png ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/png2ff
@chmod 755 ${DESTDIR}${PREFIX}/bin/ff2png
uninstall:
@echo removing executable files from ${DESTDIR}${PREFIX}/bin
@echo removing from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/png2ff
@rm -f ${DESTDIR}${PREFIX}/bin/ff2png
.PHONY: all options clean install uninstall
.PHONY: all clean install uninstall
o handle truecolor PNG's properly (libpng is painful to use)
o write simpler Makefile
o re-add the old imagefile-tools for gif, jpg, ...
......@@ -3,21 +3,10 @@
# paths
PREFIX = /usr/local
# libs
LIBS =
PNG_LIBS = -lpng
JPEG_LIBS = -ljpeg
GIF_LIBS = -lgif
# flags
CPPFLAGS =
# debug
#CFLAGS = -std=c99 -pedantic -Wall -Wextra -O0 -g -ggdb ${CPPFLAGS}
#LDFLAGS = ${LIBS}
# optimized
CFLAGS = -std=c99 -pedantic -Wall -Wextra -D_DEFAULT_SOURCE -Os ${CPPFLAGS}
LDFLAGS = -s ${LIBS}
CPPFLAGS = -D_DEFAULT_SOURCE
CFLAGS = -std=c99 -pedantic -Wall -Wextra -Os ${CPPFLAGS}
LDFLAGS = -s -lpng -ljpeg -lgif
# compiler and linker
CC = cc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment