# @(#)makefile 2.3 1/16/96 # the following can be added to CFLAGS for various things # # add -DNOVOID If your compiler can not handle the void keyword. # add -DBSD For BSD4.[23] UNIX Systems. # add -DDOS For MS-DOS/PC-DOS Systems, Micro-Soft C 4.0, Turbo C # Use the ANSI option. # add -DNOGETOPT If your library doesn't have getopt(). # Another routine will be used in its place. # add -DNOVARARGS If you have neither (ANSI C) or # (pre-ANSI C). # Another method will be compiled instead. # add -Ddodebug To compile in debugging trace statements. # add -Ddoyydebug To compile in yacc trace statements. # # add -DUSE_READLINE To compile in support for the GNU readline library. CFLAGS+= -s -DUSE_READLINE CC?= gcc LIBS= -lreadline -ltermcap ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++ BINDIR= $(PREFIX)/bin MANDIR= $(PREFIX)/man/man1 CATDIR= $(PREFIX)/man/cat1 INSTALL= install -c INSTALL_DATA= install -c -m 644 cdecl: c++decl ln c++decl cdecl c++decl: cdgram.c cdlex.c cdecl.c $(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS) rm -f cdecl cdlex.c: cdlex.l lex cdlex.l && mv lex.yy.c cdlex.c cdgram.c: cdgram.y yacc cdgram.y && mv y.tab.c cdgram.c test: ./cdecl < testset ./c++decl < testset++ install: cdecl ${BSD_INSTALL_PROGRAM} cdecl $(BINDIR) ln $(BINDIR)/cdecl $(BINDIR)/c++decl ${BSD_INSTALL_MAN} cdecl.1 $(MANDIR) ${BSD_INSTALL_MAN} c++decl.1 $(MANDIR) clean: rm -f cdgram.c cdlex.c cdecl y.output c++decl clobber: clean rm -f $(BINDIR)/cdecl $(BINDIR)/c++decl rm -f $(MANDIR)/cdecl.1 $(MANDIR)/c++decl.1 rm -f $(CATDIR)/cdecl.1.gz cdecl.cpio: $(ALLFILES) ls $(ALLFILES) | cpio -ocv > cdecl.cpio cdecl.shar: $(ALLFILES) shar $(ALLFILES) > cdecl.shar