scc

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

Makefile (1338B)


      1 .POSIX:
      2 
      3 DIRS =\
      4 	amd64-sysv\
      5 	arm64-sysv\
      6 	i386-sysv\
      7 	qbe\
      8 	qbe_amd64-sysv\
      9 	qbe_arm64-sysv\
     10 	z80-scc\
     11 
     12 PROJECTDIR = ../../../..
     13 include $(PROJECTDIR)/scripts/rules.mk
     14 
     15 MORE_LDLIBS = -lscc
     16 
     17 OBJS =\
     18 	code.o\
     19 	main.o\
     20 	node.o\
     21 	parser.o\
     22 	symbol.o\
     23 
     24 TARGET  =\
     25 	cc2-amd64-sysv\
     26 	cc2-i386-sysv\
     27 	cc2-qbe_amd64-sysv\
     28 	cc2-qbe_arm64-sysv\
     29 	cc2-z80-scc\
     30 
     31 all:
     32 	+@$(MAKE) $(DIRS)
     33 	+@$(MAKE) $(TARGET)
     34 	@cp $(TARGET) $(LIBEXEC)/scc
     35 
     36 main.o: error.h
     37 qbe_amd64-sysv qbe_arm64-sysv: qbe
     38 qbe_amd64-sysv: amd64-sysv
     39 qbe_arm64-sysv: arm64-sysv
     40 
     41 error.h: cc2.h
     42 	rm -f $@;\
     43 	trap 'rm -f $$$$.h' EXIT INT QUIT TERM HUP;\
     44 	awk -f generror.awk cc2.h > $$$$.h && mv $$$$.h $@
     45 
     46 cc2-amd64-sysv: $(LIBSCC) $(OBJS) amd64-sysv/builtin.o
     47 	$(CC) $(PROJ_LDFLAGS) $(OBJS) amd64-sysv/builtin.o $(PROJ_LDLIBS) -o $@
     48 
     49 cc2-i386-sysv: $(LIBSCC) $(OBJS) i386-sysv/builtin.o
     50 	$(CC) $(PROJ_LDFLAGS) $(OBJS) i386-sysv/builtin.o $(PROJ_LDLIBS) -o $@
     51 
     52 cc2-qbe_amd64-sysv: $(LIBSCC) $(OBJS) qbe_amd64-sysv/builtin.o
     53 	$(CC) $(PROJ_LDFLAGS) $(OBJS) qbe_amd64-sysv/builtin.o $(PROJ_LDLIBS) -o $@
     54 
     55 cc2-qbe_arm64-sysv: $(LIBSCC) $(OBJS) qbe_arm64-sysv/builtin.o
     56 	$(CC) $(PROJ_LDFLAGS) $(OBJS) qbe_arm64-sysv/builtin.o $(PROJ_LDLIBS) -o $@
     57 
     58 cc2-z80-scc: $(LIBSCC) $(OBJS) z80-scc/builtin.o
     59 	$(CC) $(PROJ_LDFLAGS) $(OBJS) z80-scc/builtin.o $(PROJ_LDLIBS) -o $@
     60 
     61 clean:
     62 	rm -f error.h