generarxml/src/Makefile

41 lines
1.0 KiB
Makefile
Raw Normal View History

2016-10-17 11:31:42 -03:00
# Este makefile es el antiguo y mas limitado, no puede detectar el entorno para verificar que la compilación va a funcionar
2016-10-16 16:55:55 -03:00
2016-10-13 15:08:01 -03:00
CC=gcc
BINDIR=out
2016-10-16 16:55:55 -03:00
SRCDIR=.
EXTRADIR=misc
2016-10-13 19:55:33 -03:00
DEBUG_FLAGS=-Wall -Werror
2016-10-13 15:08:01 -03:00
2016-10-16 14:16:03 -03:00
CFLAGS=$(DEBUG_FLAGS) -ggdb -Wconversion -std=c11 -D_DEFAULT_SOURCE $(shell pkg-config libxml-2.0 --cflags) -ansi
2016-10-13 15:08:01 -03:00
LDFLAGS=$(shell pkg-config libxml-2.0 --libs)
2016-10-16 14:16:03 -03:00
#CPPFLAGS
# DEBUG: show debug information during runtime
# DEBUG_ENCODING: show debug information related to encoding at runtime
CPPFLAGS=-DDEBUG
2016-10-13 15:08:01 -03:00
BINARY=generarxml
OBJS = \
2016-10-16 16:55:55 -03:00
$(SRCDIR)/main.o \
$(SRCDIR)/readconfig.o \
$(SRCDIR)/readfile.o \
$(SRCDIR)/encoding.o \
$(SRCDIR)/string.o
2016-10-13 15:08:01 -03:00
all: bin
bin: $(OBJS)
2016-10-16 16:55:55 -03:00
[ -d "out" ] && echo ¨out already exists¨ || mkdir -v out
2016-10-16 14:16:03 -03:00
$(CC)$(xml2-config --cflags --libs) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(BINDIR)/$(BINARY)
2016-10-16 16:55:55 -03:00
cp $(EXTRADIR)/*.conf $(BINDIR)/
cp $(EXTRADIR)/*.dtd $(BINDIR)/
cp $(EXTRADIR)/*.txt $(BINDIR)/
2016-10-13 15:08:01 -03:00
clean:
2016-10-16 16:55:55 -03:00
rm -fR $(BINDIR) $(SRCDIR)/*.o
2016-10-13 15:08:01 -03:00
%.o: %.c
2016-10-16 14:16:03 -03:00
$(CC)$(xml2-config --cflags --libs) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $< -o $@