]>
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 | |
20 | @if [ -z "$(RC_ARCHS)" -o -n "$(RC_i386)" ]; then \ | |
21 | $(MAKE) install_i386 OBJROOT=${OBJROOT} \ | |
22 | SYMROOT=${SYMROOT} DSTROOT=${DSTROOT} \ | |
23 | SRCROOT=${SRCROOT}; \ | |
24 | else \ | |
25 | echo i386 not selected - null build.; \ | |
26 | fi | |
27 | ||
28 | install_i386:: all | |
29 | ||
30 | installhdrs:: | |
31 | ||
32 | clean:: | |
33 | /bin/rm -rf $(OBJROOT) *~ | |
34 | ||
35 | .SUFFIXES: .s .i .c .o | |
36 | ||
37 | .c.o .m.o: | |
38 | $(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $(OBJROOT)/$*.o \ | |
39 | -MD -dependency-file $(OBJROOT)/$*.d | |
40 | md -u $(OBJROOT)/Makedep -f -d $(OBJROOT)/$*.d | |
41 | ||
42 | #.s.o: | |
43 | # cc $(INC) -E $< > $(OBJROOT)/$*.o2 | |
44 | # $(AS) -o $(OBJROOT)/$@ $(OBJROOT)/$*.o2 | |
45 | ||
46 | .s.o: | |
47 | cc -c $(INC) -arch i386 -o $(OBJROOT)/$(@F) $< | |
48 | ||
49 | $(DIRS_NEEDED) $(INSTALLDIR) $(SRCROOT): | |
50 | $(MKDIRS) $@ |