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

Ignore object files #31

Merged
merged 1 commit into from
Mar 24, 2017
Merged

Ignore object files #31

merged 1 commit into from
Mar 24, 2017

Conversation

chriso
Copy link
Contributor

@chriso chriso commented Mar 24, 2017

munit.o should be ignored.

@nemequ nemequ merged commit c0183fb into nemequ:master Mar 24, 2017
@nemequ
Copy link
Owner

nemequ commented Mar 24, 2017

Merged, thanks.

µnit's Makefile doesn't generate an *.o, how are you getting this? Integration with an autotools build system? I'm just wondering if there are other patterns we should ignore, too…

@chriso
Copy link
Contributor Author

chriso commented Mar 24, 2017

Thanks. I'm using the following dir structure:

└── lib
└── test
    └── munit (git submodule)
    └── Makefile
    └── *.c

The test Makefile uses the following to build $(OBJ) for linking:

SRC := $(wildcard *.c) munit/munit.c
OBJ := $(SRC:.c=.o)

.c.o:
	$(CC) $(CFLAGS) -c -o $@ $<

This drops a munit.o file in test/munit, dirtying the git submodule.

I suppose I could have used this instead:

SRC := $(wildcard *.c)
OBJ := $(SRC:.c=.o) munit.o

.c.o:
	$(CC) $(CFLAGS) -c -o $@ $<

munit.o: munit/munit.c
	$(CC) $(CFLAGS) -c -o $@ $^

@chriso chriso deleted the patch-1 branch March 24, 2017 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants