forked from chris2511/xca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules.mak
38 lines (28 loc) · 902 Bytes
/
Rules.mak
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
include $(BUILD)/Local.mak
export VERSION=$(shell cat $(TOPDIR)/VERSION )
BASENAME=$(shell basename `pwd`)
CPPFLAGS += -I$(TOPDIR) -I$(BUILD) -I$(BUILD)/ui
all: .build-stamp
.build-stamp: $(OBJS)
for i in $(patsubst %, $(shell pwd)/%, $(OBJS)); do echo $$i; done > $@
@$(PRINT) " DONE [$(BASENAME)]"
SRCS=$(patsubst %.o, %.cpp, $(OBJS))
HEADERS=$(shell ls *.h 2>/dev/null)
GCH=$(patsubst %, %.gch, $(HEADERS))
# how to create a moc_* file
moc_%.cpp: %.h %.cpp
@$(PRINT) " MOC [$(BASENAME)] $@"
$(MOC) $< -o $@
# how to create the headerfile from the *.ui
ui_%.h: %.ui
@$(PRINT) " UIC [$(BASENAME)] $@"
$(UIC) -o $@ $<
# default compile rule
%.o: %.cpp
@$(PRINT) " CC [$(BASENAME)] $@"
$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
.depend: $(SRCS)
@$(PRINT) " DEP [$(BASENAME)]"
$(CC) -MM $(CPPFLAGS) $(CFLAGS) $^ > $@
.SECONDARY:
.PHONY: .build-stamp