61 lines
2.1 KiB
Makefile
61 lines
2.1 KiB
Makefile
CC ?= gcc
|
|
CXX ?= g++
|
|
# Added -I. to search the local directory for <header.h> files
|
|
CFLAGS ?= -Wall -O2 -I../include -D_GNU_SOURCE -DYYDEBUG=1
|
|
PKG_CONFIG ?= pkg-config
|
|
HOSTPKG_CONFIG = $(PKG_CONFIG)
|
|
|
|
# Core engine files
|
|
CORE_SRCS := confdata.c expr.c symbol.c menu.c preprocess.c util.c parser.tab.c lexer.lex.c
|
|
CORE_OBJS := $(CORE_SRCS:.c=.o)
|
|
|
|
all: conf mconf nconf
|
|
|
|
parser.tab.c: parser.y
|
|
bison -t -d -o $@ $<
|
|
|
|
lexer.lex.c: lexer.l
|
|
flex -o $@ $<
|
|
|
|
$(CORE_OBJS): %.o: %.c
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
conf: conf.c $(CORE_OBJS)
|
|
$(CC) $(CFLAGS) -o $@ conf.c $(CORE_OBJS)
|
|
|
|
mconf: mconf.c mnconf-common.c $(CORE_OBJS) $(wildcard lxdialog/*.c)
|
|
$(CC) $(CFLAGS) -o $@ mconf.c mnconf-common.c $(CORE_OBJS) $(wildcard lxdialog/*.c) -lncurses
|
|
|
|
nconf: nconf.c nconf.gui.c mnconf-common.c $(CORE_OBJS)
|
|
$(CC) $(CFLAGS) -o $@ nconf.c nconf.gui.c mnconf-common.c $(CORE_OBJS) -lncurses -lmenu -lpanel
|
|
|
|
# --- gconfig (GTK 3) -------------------------------------------------------
|
|
|
|
gconf-cflags gconf-libs: gconf-cfg.sh
|
|
HOSTPKG_CONFIG=$(HOSTPKG_CONFIG) sh $< gconf-cflags gconf-libs
|
|
|
|
gconf: gconf.c $(CORE_OBJS) gconf-cflags gconf-libs
|
|
$(CC) $(CFLAGS) $$(cat gconf-cflags) -c -o gconf.o gconf.c
|
|
$(CC) $(CFLAGS) -o $@ gconf.o $(CORE_OBJS) $$(cat gconf-libs)
|
|
|
|
# --- xconfig (Qt) ----------------------------------------------------------
|
|
|
|
qconf-cflags qconf-libs qconf-bin: qconf-cfg.sh
|
|
HOSTPKG_CONFIG=$(HOSTPKG_CONFIG) sh $< qconf-cflags qconf-libs qconf-bin
|
|
|
|
qconf-moc.cc: qconf.h qconf-bin qconf-cflags
|
|
@MOC=$$(cat qconf-bin); if [ -x "$$MOC/moc6" ]; then MOC="$$MOC/moc6"; else MOC="$$MOC/moc"; fi; $$MOC $< -o $@
|
|
|
|
qconf.o: qconf.cc qconf-cflags qconf-bin
|
|
$(CXX) $(CFLAGS) -fPIC $$(cat qconf-cflags) -c -o $@ qconf.cc
|
|
|
|
qconf-moc.o: qconf-moc.cc qconf-cflags
|
|
$(CXX) $(CFLAGS) -fPIC $$(cat qconf-cflags) -c -o $@ qconf-moc.cc
|
|
|
|
qconf: qconf.o qconf-moc.o $(CORE_OBJS) qconf-cflags qconf-libs
|
|
$(CXX) -o $@ qconf.o qconf-moc.o $(CORE_OBJS) $$(cat qconf-libs)
|
|
|
|
clean:
|
|
rm -f conf mconf nconf gconf qconf parser.tab.* lexer.lex.*
|
|
rm -f $(CORE_OBJS) gconf.o qconf.o qconf-moc.o qconf-moc.cc
|
|
rm -f gconf-cflags gconf-libs qconf-cflags qconf-libs qconf-bin
|