Move the objs directory underneath the build directory when building with
the Makefile.
This commit is contained in:
parent
2aff36a274
commit
2a1885bab4
6
Makefile
6
Makefile
@ -10,7 +10,7 @@ IFCHD_OBJS = $(IFCHD_SRCS:.c=.o)
|
|||||||
NDHC_OBJS = $(NDHC_SRCS:.c=.o)
|
NDHC_OBJS = $(NDHC_SRCS:.c=.o)
|
||||||
NCM_INC = -I./ncmlib
|
NCM_INC = -I./ncmlib
|
||||||
BUILD_DIR = build
|
BUILD_DIR = build
|
||||||
OBJ_DIR = objs
|
OBJ_DIR = $(BUILD_DIR)/objs
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
AR = ar
|
AR = ar
|
||||||
@ -20,10 +20,10 @@ CFLAGS = -O2 -s -std=gnu99 -pedantic -Wall -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX
|
|||||||
all: makedir ncmlib.a ifchd ndhc
|
all: makedir ncmlib.a ifchd ndhc
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -Rf $(OBJ_DIR) $(BUILD_DIR)
|
rm -Rf $(BUILD_DIR)
|
||||||
|
|
||||||
makedir:
|
makedir:
|
||||||
mkdir -p $(OBJ_DIR)/ndhc $(OBJ_DIR)/ifchd $(OBJ_DIR)/ncmlib $(BUILD_DIR)
|
mkdir -p $(BUILD_DIR) $(OBJ_DIR)/ndhc $(OBJ_DIR)/ifchd $(OBJ_DIR)/ncmlib
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $(NCM_INC) -c -o $(OBJ_DIR)/$@ $<
|
$(CC) $(CFLAGS) $(NCM_INC) -c -o $(OBJ_DIR)/$@ $<
|
||||||
|
Loading…
Reference in New Issue
Block a user