-
Notifications
You must be signed in to change notification settings - Fork 2
/
default.mak
62 lines (46 loc) · 1.29 KB
/
default.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
include $(TOPDIR)/defines.mak
include $(TOPDIR)/rules.mak
CPPFLAGS= $(CFLAGS)
all: $(SUBDIRS) $(OUTPUT) $(MISCOUTPUT) $(MISCOBJECTS)
$(SUBDIRS): dummy
make -C $@
$(filter %.a,$(OUTPUT)): $(OBJECTS)
$(AR) rcs $@ $^
$(filter %.lib,$(OUTPUT)): $(OBJECTS)
@lib -nologo -out:$@ $^
clean:
$(CLEANOBJ)
$(CLEANOUT)
$(CLEANSUBS)
dummy:
#dependancy generation v2. Works correctly for all file types. No more errors. Yay.
# -Matt Mueller
#DEPFILE=.depend
#use dep.dep instead of .depend for dos compatibility.
DEPFILE=dep.dep
ifdef OUTPUT
DEPOBJ2=$(OBJECTS:.$(OBJ)=.dep2) $(MISCOBJECTS:.$(OBJ)=.dep2)
endif
#we don't actually create .dep2 files, but we need some way to let make do its
#magic of finding the correct source file (since a .o can be made by many types
#of source files.)
%.dep2: %.c
$(CC) $(CFLAGS) $(E_CFLAGS) -MM $< >> $(DEPFILE)
%.dep2: %.cpp
$(CXX) $(CFLAGS) $(E_CFLAGS) -MM $< >> $(DEPFILE)
#dunno if this is the "right" way to make null rules, but it seems to work.
%.dep2: %.asm
-
%.dep2: %.S
-
%.dep2: %.s
-
dep depend:
-rm $(DEPFILE)
make dep2_internal
$(DEPSUBS)
#use two step dep process so it can delete .depend first. (since the rules dependancies are done before the rules actions)
dep2_internal: $(DEPOBJ2)
ifeq ($(DEPFILE),$(wildcard $(DEPFILE)))
include $(DEPFILE)
endif