Added my own implementation of "Hello world" as an example.
This commit is contained in:
72
Makefile.in
Normal file
72
Makefile.in
Normal file
@@ -0,0 +1,72 @@
|
||||
# @Makefile.in@
|
||||
|
||||
PREFIX := @PREFIX@
|
||||
BINDIR := @BINDIR@
|
||||
MAN1DIR := @MAN1DIR@
|
||||
|
||||
MAIN := hello
|
||||
OBJS := hello.o
|
||||
#LIBS :=
|
||||
MAN1 := hello.1
|
||||
|
||||
MANGZ := @MANGZ@
|
||||
ifeq ($(MANGZ), 1)
|
||||
MAN1 := $(addsuffix .gz, $(MAN1))
|
||||
endif
|
||||
|
||||
CC := @CC@
|
||||
CP := @CP@
|
||||
GZIP := @GZIP@
|
||||
INSTALL := @INSTALL@
|
||||
RM := @RM@
|
||||
STRIP := @STRIP@
|
||||
TAR := @TAR@
|
||||
|
||||
.PHONY: help strip install install-bin install-man install-man1 uninstall \
|
||||
clean distclean mrproper dist
|
||||
.DEFAULT: $(MAIN)
|
||||
|
||||
$(MAIN): $(OBJS)
|
||||
ifeq (@STATIC@, 1)
|
||||
$(CC) --static -g -o $(MAIN) $(LIBS) $(OBJS)
|
||||
else
|
||||
$(CC) -g -o $(MAIN) $(LIBS) $(OBJS)
|
||||
endif
|
||||
|
||||
%.o : %.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
||||
|
||||
help:
|
||||
@echo "There is no help."
|
||||
|
||||
strip: $(MAIN)
|
||||
$(STRIP) $(MAIN)
|
||||
|
||||
install: install-bin install-man
|
||||
|
||||
install-bin: strip
|
||||
$(INSTALL) $(MAIN) $(BINDIR)
|
||||
|
||||
install-man: install-man1
|
||||
|
||||
install-man1: $(MAN1)
|
||||
$(INSTALL) $^ $(MAN1DIR)
|
||||
|
||||
%.gz : %
|
||||
$(GZIP) -c $< > $@
|
||||
|
||||
uninstall:
|
||||
-$(RM) $(BINDIR)/$(MAIN)
|
||||
cd $(MAN1DIR) ; -$(RM) $(MAN1)
|
||||
|
||||
clean:
|
||||
$(RM) -f *.o $(MAIN)
|
||||
|
||||
distclean: clean
|
||||
$(CP) Makefile.dist Makefile
|
||||
mrproper: distclean
|
||||
|
||||
dist: distclean
|
||||
cd .. ; $(TAR) -czf $(notdir $(PWD)).tar.gz $(notdir $(PWD))
|
||||
|
||||
#end
|
||||
Reference in New Issue
Block a user