Skip to content

Commit 1230a48

Browse files
committed
Make lib.misc compile as C++.
1 parent 0861bd7 commit 1230a48

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Makefile.global

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ endef
6262
# Library objects required in multiple places:
6363
LIBSBASE = $(addprefix $(TOPDIR)/lib/,lib.error lib.misc)
6464
LIBHEADERS = $(addsuffix .h,$(LIBSBASE))
65-
LIBSOURCES = $(addsuffix .c,$(LIBSBASE))
6665
LIBOBJECTS = $(addsuffix $(OBJEXT),$(LIBSBASE))
6766
CFLAGS += -I$(TOPDIR)/lib -I$(TOPDIR)/etc
6867
CXXFLAGS += -I$(TOPDIR)/lib -I$(TOPDIR)/etc
6968

70-
$(LIBOBJECTS): %$(OBJEXT): %.c %.h
69+
$(LIBOBJECTS):
7170
$(MAKE) -C $(TOPDIR)/lib $(notdir $@)
7271

7372
# Default recursive targets; these should always at least call the

judge/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ judgehost: $(TARGETS) $(SUBST_FILES)
1313
$(SUBST_FILES): %: %.in $(TOPDIR)/paths.mk
1414
$(substconfigvars)
1515

16-
evict: evict.cc $(LIBHEADERS) $(LIBSOURCES)
17-
$(CXX) $(CXXFLAGS) -o $@ $< $(LIBSOURCES)
16+
evict: evict.cc $(LIBOBJECTS)
17+
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LIBOBJECTS)
1818

19-
runguard: runguard.cc $(LIBHEADERS) $(LIBSOURCES) $(TOPDIR)/etc/runguard-config.h
20-
$(CXX) $(CXXFLAGS) -o $@ $< $(LIBSOURCES) $(LIBCGROUP)
19+
runguard: runguard.cc $(LIBOBJECTS) $(TOPDIR)/etc/runguard-config.h
20+
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LIBOBJECTS) $(LIBCGROUP)
2121

22-
runpipe: runpipe.cc $(LIBHEADERS) $(LIBSOURCES)
23-
$(CXX) $(CXXFLAGS) -static -o $@ $< $(LIBSOURCES)
22+
runpipe: runpipe.cc $(LIBOBJECTS)
23+
$(CXX) $(CXXFLAGS) $(LDFLAGS) -static -o $@ $< $(LIBOBJECTS)
2424

2525
install-judgehost:
2626
$(INSTALL_PROG) -t $(DESTDIR)$(judgehost_libjudgedir) \

lib/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ endif
44

55
include $(TOPDIR)/Makefile.global
66

7-
OBJECTS = $(addsuffix $(OBJEXT),lib.error lib.misc)
7+
OBJECTS = lib.error$(OBJEXT) lib.misc$(OBJEXT)
88

99
build: $(OBJECTS)
1010

11-
$(OBJECTS): %$(OBJEXT): %.c %.h
11+
lib.error$(OBJEXT): lib.error.c lib.error.h
12+
lib.misc$(OBJEXT): lib.misc.cc lib.misc.h
1213

1314
clean-l:
1415
rm -f $(OBJECTS)
File renamed without changes.

0 commit comments

Comments
 (0)