scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

Makefile (743B)


      1 .POSIX:
      2 
      3 LIBDIR    = ../../lib/scc
      4 include ../../config.mk
      5 include $(LIBDIR)/libdep.mk
      6 
      7 OBJ = scc.o
      8 HDR = config.h \
      9       ../../inc/scc.h \
     10       ../../inc/arg.h \
     11       ../../inc/syslibs.h \
     12       ../../inc/ldflags.h
     13 
     14 all: scc scpp
     15 	mkdir -p ../../rootdir/bin
     16 	cp scc scpp ../../rootdir/bin/
     17 
     18 dep:
     19 	PREFIX=$(PREFIX) USEQBE=$(USEQBE) ./gendep.sh $(TARGETS)
     20 
     21 $(OBJ): $(HDR)
     22 
     23 scc: $(OBJ) $(LIBDIR)/libscc.a
     24 	$(CC) $(SCC_LDFLAGS) $(OBJ) -lscc -o $@
     25 
     26 scpp: cpp.sh config.h
     27 	set -x ;\
     28 	trap "rm -f $$$$.sh" 0 2 3;\
     29 	rm -f $@ ;\
     30 	sed "s%@PREFIX@%$(PREFIX)%" < cpp.sh > $$$$.sh && \
     31 	chmod +x $$$$.sh && \
     32 	mv $$$$.sh scpp
     33 
     34 $(LIBDIR)/libscc.a:
     35 	cd $(LIBDIR) && $(MAKE)
     36 
     37 clean:
     38 	rm -f $(OBJ)
     39 	rm -f scc
     40 	rm -f scpp
     41 
     42 distclean: clean
     43 	rm -f config.h
     44