scc

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

Makefile (768B)


      1 .POSIX:
      2 
      3 PREFIX = /usr/local
      4 PROJECTDIR = ../../../..
      5 include $(PROJECTDIR)/scripts/rules.mk
      6 
      7 TARGETS =\
      8 	$(BINDIR)/scc-cc\
      9 	$(BINDIR)/scc-cpp\
     10 	$(BINDIR)/scc\
     11 
     12 all: $(TARGETS)
     13 
     14 $(BINDIR)/scc-cc: $(LIBSCC) cc.o
     15 	$(CC) $(PROJ_LDFLAGS) cc.o -lscc $(PROJ_LDLIBS) -o $@
     16 
     17 $(BINDIR)/scc-cpp: scc.sh
     18 	cp scc.sh $@
     19 	chmod +x $@
     20 
     21 $(BINDIR)/scc: scc.sh
     22 	cp scc.sh $@
     23 	chmod +x $@
     24 
     25 config.h:
     26 	set -e;\
     27 	rm -f $@;\
     28 	trap "rm -f $$$$.h" EXIT QUIT HUP TERM;\
     29 	(echo '#define PREFIX "$(PREFIX)"';\
     30 	 echo '#define ARCH "$(ARCH)"';\
     31 	 echo '#define SYS  "$(SYS)"';\
     32 	 echo '#define ABI  "$(ABI)"';\
     33 	 echo '#define LIBPREFIX "$(LIBPREFIX)"';\
     34 	 echo '#define FORMAT "$(FORMAT)"') > $$$$.h && mv $$$$.h $@
     35 
     36 clean:
     37 	rm -f scc scpp *.o
     38 	rm -f $(TARGETS)
     39 	rm -f config.h
     40 
     41 include deps.mk