Created
January 30, 2012 08:55
-
-
Save rajatkhanduja/1703426 to your computer and use it in GitHub Desktop.
Example of a Makefile to make use of a general rule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRC = src | |
OBJ = obj | |
BIN = bin | |
CC = gcc | |
DEFINES = | |
CFLAGS = -Iinclude/ | |
OBJECTS = ${OBJ}/fsm.o ${OBJ}/set.o ${OBJ}/regex_parser.o ${OBJ}/regex_to_fsm.o ${OBJ}/main.o | |
all: ${OBJECTS} | |
${CC} $^ -g -o ${BIN}/lexical_analyzer.out | |
${OBJ}/%.o : ${SRC}/%.c | |
${CC} -c -g ${DEFINES} ${CFLAGS} $< -o $@ | |
clean: | |
rm -f ${OBJ}/*.o | |
rm -f ${BIN}/*.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment