Some fixes for building on Linux and Clang
  [Thread Prev] | [Thread Next]
 
 
- Subject: Some fixes for building on Linux and Clang
- From: Ryan Gonzalez <rymg19@xxxxxxxxx>
- Date: Sun, 15 Nov 2015 15:19:10 -0600
- To: myrddin-dev@xxxxxxxxxxxxxx
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 $<
| Re: Some fixes for building on Linux and Clang | Ori Bernstein <ori@xxxxxxxxxxxxxx> | 
- Prev by Date: End-Of-Array operator
- Next by Date: Crash!
- Previous by thread: End-Of-Array operator
- Next by thread: Re: Some fixes for building on Linux and Clang
- Index(es):