scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

Makefile (1344B)


      1 .POSIX:
      2 
      3 PROJECTDIR = ../..
      4 include $(PROJECTDIR)/scripts/rules.mk
      5 
      6 TARGET = $(BINDIR)/nm \
      7          $(BINDIR)/strip \
      8          $(BINDIR)/size \
      9          $(BINDIR)/ar \
     10          $(BINDIR)/ld \
     11          $(BINDIR)/ranlib \
     12          $(BINDIR)/objdump \
     13          $(BINDIR)/objcopy \
     14          $(BINDIR)/addr2line \
     15 
     16 DIRS   = as scc
     17 
     18 LIBMACH = $(LIBDIR)/libmach.a
     19 LIBSCC  = $(LIBDIR)/libscc.a
     20 
     21 all: $(TARGET) $(DIRS)
     22 
     23 $(DIRS): FORCE
     24 	@+cd $@ && $(MAKE)
     25 
     26 $(BINDIR)/nm: nm.o $(LIBMACH) $(LIBSCC)
     27 	$(CC) $(SCC_LDFLAGS) nm.o -lmach -lscc -o $@
     28 
     29 $(BINDIR)/strip: strip.o $(LIBMACH) $(LIBSCC)
     30 	$(CC) $(SCC_LDFLAGS) strip.o -lmach -lscc -o $@
     31 
     32 $(BINDIR)/size: size.o $(LIBMACH) $(LIBSCC)
     33 	$(CC) $(SCC_LDFLAGS) size.o -lmach -lscc -o $@
     34 
     35 $(BINDIR)/ranlib: ranlib.o $(DRIVER).o $(LIBMACH) $(LIBSCC)
     36 	$(CC) $(SCC_LDFLAGS) ranlib.o $(DRIVER).o -lmach -lscc -o $@
     37 
     38 $(BINDIR)/ld: ld.o $(LIBMACH) $(LIBSCC)
     39 	$(CC) $(SCC_LDFLAGS) ld.o -lmach -lscc -o $@
     40 
     41 $(BINDIR)/objdump: objdump.o $(LIBMACH)
     42 	$(CC) $(SCC_LDFLAGS) objdump.o -lmach -o $@
     43 
     44 $(BINDIR)/objcopy: objcopy.o $(LIBMACH)
     45 	$(CC) $(SCC_LDFLAGS) objcopy.o -lmach -o $@
     46 
     47 $(BINDIR)/addr2line: addr2line.o $(LIBMACH) $(LIBSCC)
     48 	$(CC) $(SCC_LDFLAGS) addr2line.o -lmach -lscc -o $@
     49 
     50 $(BINDIR)/ar: ar.o $(DRIVER).o
     51 	$(CC) $(SCC_LDFLAGS) ar.o $(DRIVER).o -o $@
     52 
     53 dep: inc-dep
     54 
     55 dep clean:
     56 	$(FORALL)
     57 
     58 include deps.mk