Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some fixes for building on Linux and Clang


Seems yacc generates y.tab.h, and Clang has WAY more warnings than GCC does.

-- 
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
http://kirbyfan64.github.io/
diff --git a/mk/c.mk b/mk/c.mk
index 5e98765..218c34c 100644
--- a/mk/c.mk
+++ b/mk/c.mk
@@ -7,7 +7,7 @@ _LIBINCPATHS=$(addprefix -I, $(dir $(DEPS)))
 _LIBPATHS=$(addprefix -l, $(patsubst lib%.a,%,$(notdir $(DEPS))))
 
 # yeah, I should probably remove -Werror, but it's nice for developing alone.
-CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -g
+CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare -Wno-array-bounds -g
 CFLAGS += -MMD -MP -MF ${_DEPSDIR}/$(subst /,-,$*).d
 
 LIB ?= $(INSTLIB)
@@ -114,7 +114,7 @@ uninstall: subdirs-uninstall $(EXTRAUNINSTALL)
 %.o: %.c $(GENHDR) .deps
 	$(CC) -c $(CFLAGS) $(_LIBINCPATHS) $<
 
-.deps: 
+.deps:
 	mkdir -p $(_DEPSDIR)
 
 config.mk: configure
diff --git a/mk/lexyacc.mk b/mk/lexyacc.mk
index b8062a1..5306d97 100644
--- a/mk/lexyacc.mk
+++ b/mk/lexyacc.mk
@@ -1,7 +1,9 @@
 .SUFFIXES:
 
 %.h %.c: %.y
+	rm -f $*.h y.tab.h
 	yacc -d -o$*.c $<
+	[ -f y.tab.h ] && mv y.tab.h $*.h
 
 %.c: %.l
 	flex -o$*.c $<

Follow-Ups:
Re: Some fixes for building on Linux and ClangOri Bernstein <ori@xxxxxxxxxxxxxx>