summaryrefslogtreecommitdiffstats
path: root/tools/make.inc
blob: 25173ae7e0c1cbe26ec6b2d1f1345d82b5af3bd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$(OBJDIR)/%.o: %.c
	@mkdir -p `dirname $@`
	@echo "CC $<"
	@$(CC) $(CFLAGS) -c $< -o $@

$(OBJDIR)/%.o: %.S
	@mkdir -p `dirname $@`
	@echo "CC $<"
	@$(CC) $(CFLAGS) -c $< -o $@

# the lame echo stuff down here is to prevent any compiler errors/warnings
# to cause an error code to get returned and thus stop the build
$(DEPFILE): $(SOURCES)
	@rm -f $(DEPFILE)
	@(for each in $(SOURCES); do \
	  obj=`echo $$each | sed -e 's/\.[cS]/.o/'`; \
	  $(CC) -MM -MT "$(OBJDIR)/$$obj" $(CFLAGS) $$each >> $(DEPFILE) 2>/dev/null; \
	done; \
	echo "oo" >/dev/null )

tags:
	@(for d in $(DIRS); do \
	    etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; \
	done)