Skip to content

Commit c23d064

Browse files
committed
Added/updated makefiles to build all sample files using one "make".
1 parent 257a77c commit c23d064

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
SUBDIRS = example
2+
3+
.PHONY: subdirs $(SUBDIRS)
4+
5+
subdirs: $(SUBDIRS)
6+
7+
$(SUBDIRS):
8+
$(MAKE) -C $@
9+
10+
CLEANDIRS = $(SUBDIRS:%=clean-%)
11+
12+
clean: $(CLEANDIRS)
13+
$(CLEANDIRS):
14+
$(MAKE) -C $(@:clean-%=%) clean
15+
16+
.PHONY: subdirs $(INSTALLDIRS)
17+
.PHONY: clean

example/DllLoader/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CXX = g++
1010
LINK = ld
1111
endif
1212

13+
RM = rm
1314
CFLAGS = -Wall -g
1415
LDFLAGS =
1516

@@ -23,3 +24,6 @@ DllLoader.exe: $(OBJ)
2324

2425
%.o: %.cc
2526
$(CC) $(CFLAGS) -c $<
27+
28+
clean:
29+
$(RM) -rf $(OBJ) DllLoader.exe

example/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
SUBDIRS = DllLoader SampleDLL
2+
3+
.PHONY: subdirs $(SUBDIRS)
4+
5+
subdirs: $(SUBDIRS)
6+
7+
$(SUBDIRS):
8+
$(MAKE) -C $@
9+
10+
CLEANDIRS = $(SUBDIRS:%=clean-%)
11+
12+
clean: $(CLEANDIRS)
13+
$(CLEANDIRS):
14+
$(MAKE) -C $(@:clean-%=%) clean
15+
16+
.PHONY: subdirs $(INSTALLDIRS)
17+
.PHONY: clean

example/SampleDLL/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CXX = g++
1010
LINK = ld
1111
endif
1212

13+
RM = rm
1314
CFLAGS = -Wall -g -DSAMPLEDLL_EXPORTS
1415
LDFLAGS = -shared
1516

@@ -20,3 +21,6 @@ SampleDLL.dll: $(OBJ)
2021

2122
%.o: %.cpp
2223
$(CXX) $(CFLAGS) -c $<
24+
25+
clean:
26+
$(RM) -rf $(OBJ) SampleDLL.dll

0 commit comments

Comments
 (0)