e54e683cf5
ysyx_22040000 李心杨 Linux calcite 6.6.18 #1-NixOS SMP PREEMPT_DYNAMIC Fri Feb 23 08:25:28 UTC 2024 x86_64 GNU/Linux 19:10:05 up 3:27, 2 users, load average: 0.16, 0.35, 0.41
40 lines
845 B
Makefile
40 lines
845 B
Makefile
NAME = conf
|
|
obj := build
|
|
SRCS += confdata.c expr.c preprocess.c symbol.c util.c
|
|
SRCS += $(obj)/lexer.lex.c $(obj)/parser.tab.c
|
|
CC = gcc
|
|
CFLAGS += -DYYDEBUG
|
|
INC_PATH += .
|
|
DISTRO = $(shell cat /etc/os-release | grep PRETTY_NAME | sed 's/PRETTY_NAME=//')
|
|
|
|
ifeq ($(DISTRO),"Gentoo Linux")
|
|
LIBS += -ltinfo
|
|
endif
|
|
|
|
ifeq ($(NAME),conf)
|
|
SRCS += conf.c
|
|
else ifeq ($(NAME),mconf)
|
|
SRCS += mconf.c $(shell find lxdialog/ -name "*.c")
|
|
LIBS += -lncurses
|
|
else
|
|
$(error bad target=$(NAME))
|
|
endif
|
|
|
|
include $(NEMU_HOME)/scripts/build.mk
|
|
|
|
$(obj)/lexer.lex.o: $(obj)/parser.tab.h
|
|
$(obj)/lexer.lex.c: lexer.l $(obj)/parser.tab.h
|
|
@echo + LEX $@
|
|
@flex -o $@ $<
|
|
|
|
$(obj)/parser.tab.c $(obj)/parser.tab.h: parser.y
|
|
@echo + YACC $@
|
|
@bison -v $< --defines=$(obj)/parser.tab.h -o $(obj)/parser.tab.c
|
|
|
|
conf:
|
|
@$(MAKE) -s
|
|
|
|
mconf:
|
|
@$(MAKE) -s NAME=mconf
|
|
|
|
.PHONY: conf mconf
|