summaryrefslogtreecommitdiffstats
path: root/.pc/0008-951-fix-calling-compiler.patch/makefiles/subdir.mk
blob: b3642113e731e2ff75afffc648840419d812ad8c (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
include $(ROOTDIR)/makefiles/config.mk

INCLUDE = $(ZINCLUDE) $(EXTERNAL_INCLUDE)

HEADERS = $(wildcard *.h)
SOURCES_CPP = $(wildcard *.cpp)
SOURCES_OBJCPP = $(wildcard *.M)
SOURCES_OBJC = $(wildcard *.m)
OBJECTS = $(patsubst %.cpp, %.o, $(SOURCES_CPP)) $(patsubst %.M, %.o, $(SOURCES_OBJCPP)) $(patsubst %.m, %.o, $(SOURCES_OBJC))

.SUFFIXES: .cpp .M .m .o .h

.cpp.o:
	@echo -n 'Compiling $@ ...'
ifdef CFLAGS_NOARCH
	@$(CC) -MM $(CFLAGS_PRE) $(INCLUDE) $< -o `basename $< .cpp`.d
	@$(CC) -c $(CFLAGS) $(INCLUDE) $<
else
	@$(CC) -MMD -c $(CFLAGS) $(INCLUDE) $<
endif
	@echo ' OK'

.M.o:
	@echo -n 'Compiling $@ ...'
ifdef CFLAGS_NOARCH
	@$(CC) -MM $(CFLAGS_PRE) $(INCLUDE) $< -o `basename $< .M`.d
	@$(CC) -c $(CFLAGS) $(INCLUDE) $<
else
	@$(CC) -MMD -c $(CFLAGS) $(INCLUDE) $<
endif
	@echo ' OK'

.m.o:
	@echo -n 'Compiling $@ ...'
ifdef CFLAGS_NOARCH
	@$(CC) -MM $(CFLAGS_PRE) $(INCLUDE) $< -o `basename $< .m`.d
	@$(CC) -c $(CFLAGS) $(INCLUDE) $<
else
	@$(CC) -MMD -c $(CFLAGS) $(INCLUDE) $<
endif
	@echo ' OK'

all: $(OBJECTS)

clean:
	@$(RM) *.o *.s *.ld *.d

-include *.d