]>
Commit | Line | Data |
---|---|---|
14c7c974 A |
1 | # |
2 | # Common makefile targets. | |
3 | # | |
4 | # Define these variables (if desired) in directory makefiles: | |
5 | # DIRS_NEEDED | |
6 | # INSTALLDIR | |
7 | # SRCROOT | |
8 | # | |
9 | ifneq "" "$(wildcard /bin/mkdirs)" | |
10 | MKDIRS = /bin/mkdirs | |
11 | else | |
12 | MKDIRS = /bin/mkdir -p | |
13 | endif | |
14 | ||
15 | installsrc:: $(SRCROOT) | |
16 | cp $(ALLSRC) $(SRCROOT) | |
17 | cd $(SRCROOT); chmod a-w $(ALLSRC) | |
18 | ||
19 | install:: installhdrs all | |
20 | ||
21 | install_i386:: all | |
22 | ||
23 | installhdrs:: | |
24 | ||
25 | clean:: | |
26 | /bin/rm -rf $(OBJROOT) *~ | |
27 | ||
28 | .SUFFIXES: .s .i .c .o | |
29 | ||
30 | .c.o .m.o: | |
31 | $(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $(OBJROOT)/$*.o \ | |
32 | -MD -dependency-file $(OBJROOT)/$*.d | |
33 | md -u $(OBJROOT)/Makedep -f -d $(OBJROOT)/$*.d | |
34 | ||
35 | #.s.o: | |
36 | # cc $(INC) -E $< > $(OBJROOT)/$*.o2 | |
37 | # $(AS) -o $(OBJROOT)/$@ $(OBJROOT)/$*.o2 | |
38 | ||
39 | .s.o: | |
40 | cc -c $(INC) -arch i386 -o $(OBJROOT)/$@ $< | |
41 | ||
42 | $(DIRS_NEEDED) $(INSTALLDIR) $(SRCROOT): | |
43 | $(MKDIRS) $@ |