summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: d6c6bb0f39030fd72e23423297c71e9273289ca9 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# See COPYING for copyright and license details

BASEDIR=..

include $(BASEDIR)/config.mk
include config.mk

CFLAGS+=-I$(BASEDIR)/$(DWB_LIB_DIRS)

DEPS=$(patsubst %.o, %.d, $(OBJ)) 

OBJ += $(BASEDIR)/$(OBJLIB)

DOBJ += $(BASEDIR)/exar/exar.do

all: $(TARGET)

$(TARGET): $(OBJ) 
	@echo $(CC) -o $@
	@$(CC) $(OBJ) -o $(TARGET) $(LDFLAGS) 

-include $(OBJ:.o=.d)
-include $(DOBJ:.do=.dd)

%.o: %.c %.h config.h dwb.h
	@echo $(CC) $<
	@$(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) 

debug: $(DTARGET)

deps.d: %.c %.h
	@echo "$(CC) -MM $@"
	@$(CC) $(CFLAGS) -MM $< -o $@


%.do: %.c %.h config.h
	@echo "${CC} $<"
	@$(CC) -c -o $@ $< $(DCFLAGS) 

$(DTARGET): $(DOBJ) 
	@echo "$(CC) $@"
	@$(CC) $(DOBJ) -o $(DTARGET) $(LDFLAGS) 

dependencies: $(DEPS)

deps: 
	$(MAKE) -B dependencies

cgdb: debug
	cgdb $(DTARGET)

clean:
	$(RM) *.o  *.do $(TARGET) $(DTARGET) *.d
	$(RM) tlds.h

.PHONY: clean all cgdb deps