Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor user's CFLAGS #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ PROGS = test1 test2 test3 test4 test5 test6 test7 test8 test9 \
test74 test75 test76 test77 test78 test79 test80 test81 \
test82 test83 test84 test85 test86 test87 test88 test89 \
test90 test91 test92 test93 test94 test95
CFLAGS += -I$(HASHDIR)
#CFLAGS += -DHASH_BLOOM=16
#CFLAGS += -O2
CFLAGS += -g
#CFLAGS += -Wstrict-aliasing=2
CFLAGS += -Wall
#CFLAGS += -Wextra
#CFLAGS += -std=c89
CFLAGS += ${EXTRA_CFLAGS}
UTH_CFLAGS += -I$(HASHDIR)
#UTH_CFLAGS += -DHASH_BLOOM=16
#UTH_CFLAGS += -O2
UTH_CFLAGS += -g
#UTH_CFLAGS += -Wstrict-aliasing=2
UTH_CFLAGS += -Wall
#UTH_CFLAGS += -Wextra
#UTH_CFLAGS += -std=c89
UTH_CFLAGS += ${EXTRA_CFLAGS}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides my high-level comments in the "Conversation" tab: should this now use ${CFLAGS} instead of ${EXTRA_CFLAGS}? I believe the purpose of EXTRA_CFLAGS was so that the user can pass their own extra stuff, but if we're going to respect their CFLAGS then they don't need this extra mechanism.


ifeq ($(HASH_DEBUG),1)
CFLAGS += -DHASH_DEBUG=1
UTH_CFLAGS += -DHASH_DEBUG=1
endif

ifeq ($(HASH_PEDANTIC),1)
CFLAGS += -pedantic
UTH_CFLAGS += -pedantic
endif

TEST_TARGET=run_tests
Expand Down Expand Up @@ -87,28 +87,28 @@ thorough:
$(MAKE) clean && CC=$(CXX) $(MAKE) tests_only EXTRA_CFLAGS='-pedantic -DHASH_USING_NO_STRICT_ALIASING -fno-strict-aliasing -DHASH_FUNCTION=HASH_MUR'

example: example.c $(HASHDIR)/uthash.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(@).c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(@).c

$(PROGS) $(UTILS) : $(HASHDIR)/uthash.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(@).c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(@).c
@$(MKGITIGN)

hashscan : $(HASHDIR)/uthash.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(MUR_CFLAGS) $(LDFLAGS) -o $@ $(@).c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) $(MUR_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(@).c
@$(MKGITIGN)

sleep_test : $(HASHDIR)/uthash.h
$(CC) $(CPPFLAGS) $(CFLAGS) -DHASH_BLOOM=16 $(LDFLAGS) -o $@ $(@).c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) -DHASH_BLOOM=16 $(CFLAGS) $(LDFLAGS) -o $@ $(@).c
@$(MKGITIGN)

keystat : $(HASHDIR)/uthash.h
$(CC) $(CPPFLAGS) $(CFLAGS) -DHASH_FUNCTION=HASH_BER $(LDFLAGS) -o keystat.BER keystat.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DHASH_FUNCTION=HASH_FNV $(LDFLAGS) -o keystat.FNV keystat.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DHASH_FUNCTION=HASH_JEN $(LDFLAGS) -o keystat.JEN keystat.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DHASH_FUNCTION=HASH_OAT $(LDFLAGS) -o keystat.OAT keystat.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DHASH_FUNCTION=HASH_SAX $(LDFLAGS) -o keystat.SAX keystat.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DHASH_FUNCTION=HASH_SFH $(LDFLAGS) -o keystat.SFH keystat.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(MUR_CFLAGS) -DHASH_FUNCTION=HASH_MUR $(LDFLAGS) -o keystat.MUR keystat.c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) -DHASH_FUNCTION=HASH_BER $(CFLAGS) $(LDFLAGS) -o keystat.BER keystat.c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) -DHASH_FUNCTION=HASH_FNV $(CFLAGS) $(LDFLAGS) -o keystat.FNV keystat.c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) -DHASH_FUNCTION=HASH_JEN $(CFLAGS) $(LDFLAGS) -o keystat.JEN keystat.c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) -DHASH_FUNCTION=HASH_OAT $(CFLAGS) $(LDFLAGS) -o keystat.OAT keystat.c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) -DHASH_FUNCTION=HASH_SAX $(CFLAGS) $(LDFLAGS) -o keystat.SAX keystat.c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) -DHASH_FUNCTION=HASH_SFH $(CFLAGS) $(LDFLAGS) -o keystat.SFH keystat.c
$(CC) $(CPPFLAGS) $(UTH_CFLAGS) $(MUR_CFLAGS) -DHASH_FUNCTION=HASH_MUR $(CFLAGS) $(LDFLAGS) -o keystat.MUR keystat.c

run_tests: $(PROGS)
perl $(TESTS)
Expand Down