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= bash
|
||||
|
||||
|
||||
#######################
|
||||
# common tool locations
|
||||
#######################
|
||||
#
|
||||
|
||||
CC= cc
|
||||
GINDENT= gindent
|
||||
MV= mv
|
||||
RM= rm
|
||||
TRUE= true
|
||||
|
||||
|
||||
#####################
|
||||
# C compiler settings
|
||||
#####################
|
||||
|
||||
# Common C compiler warnings to silence
|
||||
#
|
||||
# Example: CSILENCE= -Wno-some-thing -Wno-another-thing
|
||||
@@ -130,6 +135,7 @@ endif
|
||||
PROG= prog
|
||||
OBJ= ${PROG}.o
|
||||
TARGET= ${PROG}
|
||||
|
||||
# If you have alternate code, try something like:
|
||||
# ALT_OBJ= ${PROG}.alt.o
|
||||
# ALT_TARGET= ${PROG}.alt
|
||||
@@ -149,37 +155,30 @@ DATA=
|
||||
#################
|
||||
# build the entry
|
||||
#################
|
||||
#
|
||||
|
||||
all: data ${TARGET}
|
||||
@${TRUE}
|
||||
|
||||
.PHONY: all data try clean clobber install
|
||||
|
||||
# how to compile
|
||||
#
|
||||
${PROG}: ${PROG}.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||
${CC} ${CFLAGS} ${PROG}.c -o $@ ${LDFLAGS}
|
||||
|
||||
# alternative executable
|
||||
#
|
||||
alt: data ${ALT_TARGET}
|
||||
@${TRUE}
|
||||
|
||||
${PROG}.alt: ${PROG}.alt.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||
|
||||
|
||||
${CC} ${CFLAGS} ${PROG}.alt.c -o $@ ${LDFLAGS}
|
||||
|
||||
# data files
|
||||
#
|
||||
data: ${DATA}
|
||||
@${TRUE}
|
||||
|
||||
# both all and alt
|
||||
#
|
||||
everything: all alt
|
||||
@${TRUE}
|
||||
|
||||
|
||||
# suggested way(s) to run the program
|
||||
#
|
||||
@@ -194,7 +193,7 @@ try: ${PROG} ${DATA}
|
||||
###############
|
||||
# utility rules
|
||||
###############
|
||||
#
|
||||
|
||||
clean:
|
||||
${RM} -f ${OBJ}
|
||||
@-if [[ -f indent.c ]]; then \
|
||||
|
||||
Reference in new issue
Block a user