improve the next/Makefile.example
Removed use of @${TRUE} in make actions.
Use `${PROG}.c` and `${PROG}.alt.c` in compile actions.
This commit is contained in:
1 parent
728af35143
commit
c075bca287
1 file changed
+12
-13
+12
-13
@@ -9,20 +9,25 @@
|
|||||||
#############################
|
#############################
|
||||||
# shell used by this Makefile
|
# shell used by this Makefile
|
||||||
#############################
|
#############################
|
||||||
#
|
|
||||||
SHELL= bash
|
SHELL= bash
|
||||||
|
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# common tool locations
|
# common tool locations
|
||||||
#######################
|
#######################
|
||||||
#
|
|
||||||
CC= cc
|
CC= cc
|
||||||
GINDENT= gindent
|
GINDENT= gindent
|
||||||
MV= mv
|
MV= mv
|
||||||
RM= rm
|
RM= rm
|
||||||
TRUE= true
|
TRUE= true
|
||||||
|
|
||||||
|
|
||||||
|
#####################
|
||||||
|
# C compiler settings
|
||||||
|
#####################
|
||||||
|
|
||||||
# Common C compiler warnings to silence
|
# Common C compiler warnings to silence
|
||||||
#
|
#
|
||||||
# Example: CSILENCE= -Wno-some-thing -Wno-another-thing
|
# Example: CSILENCE= -Wno-some-thing -Wno-another-thing
|
||||||
@@ -130,6 +135,7 @@ endif
|
|||||||
PROG= prog
|
PROG= prog
|
||||||
OBJ= ${PROG}.o
|
OBJ= ${PROG}.o
|
||||||
TARGET= ${PROG}
|
TARGET= ${PROG}
|
||||||
|
|
||||||
# If you have alternate code, try something like:
|
# If you have alternate code, try something like:
|
||||||
# ALT_OBJ= ${PROG}.alt.o
|
# ALT_OBJ= ${PROG}.alt.o
|
||||||
# ALT_TARGET= ${PROG}.alt
|
# ALT_TARGET= ${PROG}.alt
|
||||||
@@ -149,37 +155,30 @@ DATA=
|
|||||||
#################
|
#################
|
||||||
# build the entry
|
# build the entry
|
||||||
#################
|
#################
|
||||||
#
|
|
||||||
all: data ${TARGET}
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
|
||||||
|
|
||||||
.PHONY: all data try clean clobber install
|
.PHONY: all data try clean clobber install
|
||||||
|
|
||||||
# how to compile
|
# how to compile
|
||||||
#
|
#
|
||||||
${PROG}: ${PROG}.c
|
${PROG}: ${PROG}.c
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
${CC} ${CFLAGS} ${PROG}.c -o $@ ${LDFLAGS}
|
||||||
|
|
||||||
# alternative executable
|
# alternative executable
|
||||||
#
|
#
|
||||||
alt: data ${ALT_TARGET}
|
alt: data ${ALT_TARGET}
|
||||||
@${TRUE}
|
|
||||||
|
|
||||||
${PROG}.alt: ${PROG}.alt.c
|
${PROG}.alt: ${PROG}.alt.c
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
${CC} ${CFLAGS} ${PROG}.alt.c -o $@ ${LDFLAGS}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# data files
|
# data files
|
||||||
#
|
#
|
||||||
data: ${DATA}
|
data: ${DATA}
|
||||||
@${TRUE}
|
|
||||||
|
|
||||||
# both all and alt
|
# both all and alt
|
||||||
#
|
#
|
||||||
everything: all alt
|
everything: all alt
|
||||||
@${TRUE}
|
|
||||||
|
|
||||||
|
|
||||||
# suggested way(s) to run the program
|
# suggested way(s) to run the program
|
||||||
#
|
#
|
||||||
@@ -194,7 +193,7 @@ try: ${PROG} ${DATA}
|
|||||||
###############
|
###############
|
||||||
# utility rules
|
# utility rules
|
||||||
###############
|
###############
|
||||||
#
|
|
||||||
clean:
|
clean:
|
||||||
${RM} -f ${OBJ}
|
${RM} -f ${OBJ}
|
||||||
@-if [[ -f indent.c ]]; then \
|
@-if [[ -f indent.c ]]; then \
|
||||||
|
|||||||
Reference in new issue
Block a user